This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/manual/run/playing-a-program.html
T
2026-09-12 18:16:27 +08:00

254 lines
13 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Playing a Program | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Playing a Program | HiAPI-C# 2025 ">
<link rel="icon" href="../../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../../public/docfx.min.css">
<link rel="stylesheet" href="../../public/main.css">
<meta name="docfx:navrel" content="../../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="">
<h1 id="playing-a-program">Playing a Program</h1>
<p>Two commands put a program into a mission, and the difference between them is where the program
lives rather than what it does: <strong>Program File</strong> references a file on disk, <strong>NC Code</strong> carries the
text inside the project.</p>
<h2 id="where-they-are">Where they are</h2>
<p>The Execution page's <strong>Mission</strong> branch. Both sit in the <strong>Program</strong> category of <strong>Add Command</strong>,
and both are placed like any other command — see <a href="building-a-mission.html">Building a Mission</a>.</p>
<h2 id="which-one-to-use">Which one to use</h2>
<ul>
<li><strong>Program File</strong> — the program stays a file, and the project stores the path. Editing the file
changes what plays next time, so this is what a CAM system's output belongs in.</li>
<li><strong>NC Code</strong> — the program text is written into the project itself. Nothing outside is referenced,
so the project travels complete. Use it for a short probe, a hand-written test, or anything you
want to keep with the project rather than beside it.</li>
</ul>
<p><strong>They do not necessarily feed the same reader.</strong> NC Code is always brand NC text. Program File
plays brand NC, NX-CL or CSV, and which one it uses is a setting on the command.</p>
<h2 id="program-file">Program File</h2>
<h3 id="point-it-at-a-program">Point it at a program</h3>
<p>Type the path, or press <strong>Browse</strong>. Both forms are accepted: a path relative to the project folder,
which is what browsing produces, or an absolute path on the server.</p>
<p>Browse opens the server's file explorer on the project folder and offers no other root, so anything
picked there is project-relative by construction. A program that lives outside the project folder is
reached by typing its absolute path into the field instead.</p>
<p>The dialog filters in four groups rather than one:</p>
<table>
<thead>
<tr>
<th>Group</th>
<th>Extensions</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>NC Files</strong></td>
<td><code>.nc</code>, <code>.anc</code>, <code>.tap</code>, <code>.eia</code>, <code>.mpf</code>, <code>.spf</code>, <code>.cnc</code>, <code>.ptp</code>, <code>.h</code> — the common brand extensions, not all of them</td>
</tr>
<tr>
<td><strong>CL Files</strong></td>
<td><code>.cl</code>, <code>.cls</code>, <code>.clsf</code></td>
</tr>
<tr>
<td><strong>CSV Files</strong></td>
<td><code>.csv</code></td>
</tr>
<tr>
<td><strong>All Files</strong></td>
<td>everything, and the backstop for a brand extension the first group does not name</td>
</tr>
</tbody>
</table>
<p><strong>The picker takes more than one file.</strong> The first goes on the command you opened it from; every
further pick becomes a <strong>new Program File command</strong> placed directly after it, in the order you
picked them, inside the same list — including inside a group. That is the quick way to bring a
folder of CAM output into a mission.</p>
<h3 id="choose-the-reader">Choose the reader</h3>
<p><strong>Play As</strong> decides which reader plays the file:</p>
<table>
<thead>
<tr>
<th>Choice</th>
<th>What plays it</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Auto (by extension)</strong></td>
<td>Picked from the extension: <code>.cl</code>, <code>.cls</code> and <code>.clsf</code> play as CL, <code>.csv</code> as CSV, and every other extension as brand NC</td>
</tr>
<tr>
<td><strong>Brand NC</strong></td>
<td>The controller brand's own reader</td>
</tr>
<tr>
<td><strong>CL (CLSF)</strong></td>
<td>The NX-CL reader</td>
</tr>
<tr>
<td><strong>CSV</strong></td>
<td>The CSV reader</td>
</tr>
</tbody>
</table>
<p>Auto is the default and is right almost always. Pin one of the other three when the extension would
route the file to the wrong reader — a CL file saved as <code>.txt</code>, say.</p>
<p>For brand NC, <em>which</em> brand is not this command's business: it is the controller set on the project,
and what its words mean is <a href="../../technique/nc-dialects/index.html">NC Dialects</a>.</p>
<h3 id="read-the-banner">Read the banner</h3>
<p>Once the field holds a path, a banner below it reports what the <strong>server</strong> can see:</p>
<ul>
<li><strong>Found</strong> — a green banner with the file's size, its modified time and its line count, and a
<strong>Preview</strong> button that shows the first 100 lines read-only.</li>
<li><strong>Not found</strong> — an orange banner saying so, and no Preview button.</li>
</ul>
<p>Typing saves the path as you type; the banner refreshes when you leave the field or press
<kbd>Enter</kbd>. An orange banner is worth trusting: it means the path does not resolve on the
machine that will play it, which is not always the machine you are typing on.</p>
<p>The first Program File in the demo mission's <strong>Roughing</strong> group, at
<code>/execution?tree=execution/mission/2/0</code>. The path field carries a project-relative path, <strong>Play As</strong>
reads <em>Auto</em>, and the green banner below reports the file's size, modified time and line count with
<strong>Preview</strong> beside it. The row and the tree label both read <code>Program File</code> followed by the path,
which is how a mission of several programs stays readable.</p>
<p><img src="playing-a-program-img/program-file.en.png" alt="The Program File command panel in the Control Tree dock: a program file path field with a Browse button, a Play As select reading Auto, and a green file information banner giving size, modified time and line count with a Preview button"></p>
<h2 id="nc-code">NC Code</h2>
<h3 id="name-it">Name it</h3>
<p><strong>Title</strong> is optional in the sense that the field may be cleared, but it is not decoration: it is
the program name the run reports under, and it is the detail the mission row brackets. A new command
arrives with <code>NC Code</code> already in the field; rename it and both the log and the row follow.</p>
<h3 id="write-it">Write it</h3>
<p>The editor is a plain monospace area — no line numbers and no syntax highlighting, because this is
NC text, not a program in a language the application parses while you type. Line and character
counts sit below it and follow what you type.</p>
<p>Two buttons act on the whole text, and both are disabled while it is empty:</p>
<ul>
<li><strong>Trim Blank Lines</strong> — trims every line and drops the ones left empty.</li>
<li><strong>Clear</strong> — empties the text, after asking.</li>
</ul>
<p>Typing saves on its own, shortly after you stop; the two buttons save at once.</p>
<p><strong>Nothing is checked while you type.</strong> The text is stored exactly as written, and a mistake in it
surfaces when the mission plays it — in <strong>NC Diagnostics</strong>, see
<a href="when-something-goes-wrong.html">When Something Goes Wrong</a>.</p>
<p>The demo mission's short hand-written pass, at <code>/execution?tree=execution/mission/5</code>. The title
above the editor is what the row brackets, and the line and character counts below it are the whole
of the feedback this editor gives.</p>
<p><img src="playing-a-program-img/nc-code.en.png" alt="The NC Code command panel: a Title field reading Inline finishing pass above a monospace text area holding a short NC program, with line and character counts and the Trim Blank Lines and Clear buttons below it"></p>
<h2 id="after-it-has-played">After it has played</h2>
<p>Every program a session read appears under the <strong>Program</strong> branch, with the passes that went over it
and the marks the run left on each line. That is where you see what happened to a line, as opposed
to what the mission asked for — see <a href="the-program-branch.html">The Program Branch</a>.</p>
<h2 id="see-also">See Also</h2>
<ul>
<li><a href="index.html">Running a Simulation</a> — the rest of running a job</li>
<li><a href="building-a-mission.html">Building a Mission</a> — the list these two commands go into</li>
<li><a href="the-program-branch.html">The Program Branch</a> — what the run recorded against each line</li>
<li><a href="the-other-commands.html">The Other Commands</a> — the rest of the command kinds, including the script that drives a session without NC</li>
<li><a class="xref" href="../../anatomy/execution/mission/NcFileCommand-panel.html">NcFileCommand Panel</a> — the component behind Program File: its fields, its picker and the endpoints behind the banner</li>
<li><a href="a-mission-that-resumes.html">A Mission That Resumes</a> — the layout these two commands sit in, and the records that bracket them</li>
<li><a class="xref" href="../../anatomy/execution/mission/NcCodeCommand-panel.html">NcCodeCommand Panel</a> — the component behind NC Code: its editor, its stats row and how it saves</li>
</ul>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>