Archived
218 lines
15 KiB
HTML
218 lines
15 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>The Program Branch | HiAPI-C# 2025 </title>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="title" content="The Program Branch | 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 "{query}"">
|
||
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
||
<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="the-program-branch">The Program Branch</h1>
|
||
|
||
<p>What the run actually read, line by line, as opposed to what the mission asked for.</p>
|
||
<p>The Execution page's Control Tree carries two roots: <strong>Mission</strong> above, <strong>Program</strong> below, at
|
||
Control-Tree path <code>execution/program</code>. Program is read-only — its nodes are what the session played
|
||
or produced: the files the mission points at, the files the run reached from them, the inline text
|
||
of the NC Code commands, one node per distinct title, and the writeback files converted from a
|
||
played file — and the transport sits in the run header at the top of the Control Tree pane, with
|
||
the run-state badge at its right end, so a run can be started, stepped and reset without leaving
|
||
the branch.</p>
|
||
<h2 id="before-anything-runs">Before anything runs</h2>
|
||
<p>The branch is not empty before a run. The service seeds it from the mission: first one node per
|
||
distinct file an enabled <strong>Program File</strong> command names — NC, CL or CSV alike, since the seed reads
|
||
the command's path and not its kind — in the order the mission lists them and reaching into nested
|
||
<strong>List</strong> commands, then one node per distinct title among the enabled
|
||
<strong>NC Code</strong> commands — so an NC Code command listed above a Program File still seeds below every
|
||
file node. Those nodes are placeholders — a file the run has not opened yet — and the branch panel
|
||
says so, badging itself <em>not run yet</em> beside the file count.</p>
|
||
<p>Three things decide what is seeded:</p>
|
||
<ul>
|
||
<li><strong>A disabled command seeds nothing.</strong> The mission's greyed <em>Program File</em> entry names a file
|
||
that never reaches the branch, and nothing beneath a disabled List reaches it either.</li>
|
||
<li><strong>Two commands naming one file seed one node.</strong> Paths are compared with case and slash direction
|
||
ignored, so a file played twice appears once. In the screenshot below the first <code>circle.ptp</code>
|
||
command sits inside the collapsed <strong>List [Roughing]</strong> and the second is the top-level
|
||
<strong>Program File</strong> row, so the branch shows one plain <code>circle.ptp</code>; the <code>×2</code> it takes once both
|
||
commands have played is in the next section.</li>
|
||
<li><strong>An NC Code command is seeded under its own title</strong>, not under a file name, because it has no
|
||
file — its text lives in the mission. The branch marks it <code>(inline)</code>, and two NC Code commands
|
||
with the same title share one node.</li>
|
||
</ul>
|
||
<p><img src="the-program-branch-img/program-before-run.en.png" alt="The Execution page before a run: the run header at the top of the Control Tree pane shows the six transport buttons and a green ready badge at its right end; under it the Mission root row, with a + at its right edge, lists nine command rows, each with a checkbox and a drag handle, two of them greyed out and unticked, and the two List rows carry their own +; the Program root below is selected and holds five nodes — circle.ptp, drill_slot.ptp, side.ptp, slide.ptp and (inline) Inline finishing pass; the Program panel in the editor row under the tree is badged not run yet beside 5 files with a round refresh button at the row's right end, above the hint to run the mission; the 3D canvas shows an uncut block, and the four Session Messages tabs carry no badge"></p>
|
||
<p><em>The Program branch at <code>/execution?tree=execution/program</code>, on a project that has not been played.
|
||
The disabled <code>Program File</code> entry in Mission has no node under Program; the enabled <code>NC Code</code>
|
||
command has one, under its title.</em></p>
|
||
<h2 id="after-a-run">After a run</h2>
|
||
<p>Playing the mission fills the same nodes in and adds any file the run reached that the mission did
|
||
not name — a subprogram call nests its callee under the caller. The panel's badge changes from
|
||
<em>not run yet</em> to <em>run data</em>, and a file the run made more than one pass over takes a <code>×</code> and a
|
||
count in its tree label.</p>
|
||
<p><img src="the-program-branch-img/program-after-run.en.png" alt="The same page after the run has finished: the badge at the right end of the run header reads finished, the Mission rows are unchanged, the first Program node reads circle.ptp ×2, the Program panel under the tree is badged run data beside 5 files with the refresh button at the row's right end, the 3D canvas shows the cut block with a gold cutter and green tool paths above it, and the Session Messages tabs carry counts — Shell 11 and NC Diagnostics 7, with Step Diagnostics and NC Manipulation still unbadged — over a list of System messages"></p>
|
||
<p><em>The same deep link once the run has finished. <code>circle.ptp ×2</code> is one node holding two passes,
|
||
because two Program File commands named the same file.</em></p>
|
||
<div class="IMPORTANT">
|
||
<h5>Important</h5>
|
||
<p>The branch is rebuilt when the run <strong>changes state</strong> — starting, pausing, finishing, being reset —
|
||
and not while it is playing. During a long run the nodes on screen are the ones the last
|
||
transition left there, so a file the run has since opened may not be listed yet. The round
|
||
refresh button at the far right end of the Program panel's badge row — across the row from the
|
||
<em>run data</em> badge and the file count, its tooltip <em>Re-read the file tree from the current
|
||
session</em> — rebuilds the branch on the spot without touching the transport; pausing rebuilds it
|
||
too, since a pause is a state change.</p>
|
||
</div>
|
||
<h2 id="reading-one-file">Reading one file</h2>
|
||
<p>Selecting a node opens the file as the run saw it: the path it was read from, a selector for the
|
||
passes made over it, and the text with what each line produced beside it.</p>
|
||
<p><img src="the-program-branch-img/program-file-passes.en.png" alt="The Program branch with circle.ptp ×2 selected and the canvas and right-hand columns switched off, so the Control Tree pane spans the window: the menu bar carries a red disconnected chip beside the four layout toggles, the run header's green finished badge sits at the far right, the Mission root row is collapsed with a + at its right edge, the Program root beneath it is open and holds five nodes — circle.ptp ×2 highlighted in blue, drill_slot.ptp, side.ptp, slide.ptp and (inline) Inline finishing pass — and the editor row's header reads Program / circle.ptp ×2; inside it the path caption NC/circle.ptp, a pass selector reading Pass (2) and #2 · re-entry beside a Follow toggle, then twenty-one numbered lines of NC with a step range printed to the right of ten of them, a footer reading 21 lines · 21 executed lines, and the window footer reading Ready"></p>
|
||
<p><em>One file node at <code>/execution?tree=execution/program/0</code>, with the canvas column switched off so the
|
||
line viewer has the width — which is why the menu-bar chip reads <strong>disconnected</strong>: the badge folds the
|
||
page's rendering connection in with its service connections, and with the canvas column off the page
|
||
holds no rendering connection (see <a href="../basics/the-app-window.html">The Application Window</a>).
|
||
The pass selector names the pass and why it was entered.</em></p>
|
||
<ul>
|
||
<li><strong>The pass selector</strong> carries one entry per pass, labelled with how that pass was entered. A
|
||
pass that an <code>M98</code>/<code>M198</code> subprogram call started carries the call word and its <code>P</code> number —
|
||
<code>M98 P8</code> — on every pass, so a subprogram the caller repeats with an <code>L</code> count or calls a second
|
||
time reads <code>×N</code> with each pass labelled by the call, never as a re-entry. A pass with no call
|
||
behind it reads <em>top</em> on the first arrival at that path and <em>re-entry</em> on every later pass over
|
||
it — whether a second Program File command named the file again or a <code>WHILE</code> or <code>GOTO</code> inside a
|
||
single play of it started a new pass. So a file the mission names once can still read <code>×N</code>, with
|
||
every pass after the first labelled re-entry.</li>
|
||
<li><strong>The step range</strong> beside a line is what that line produced. A line with no range beside it ran
|
||
and produced no motion: <code>G</code> and <code>M</code> words that set state, and the tape marks, all execute without
|
||
cutting anything.</li>
|
||
<li><strong>A line missing from the marks altogether did not run in that pass.</strong> That is the difference the
|
||
branch exists to show, and it is per pass — the same line can be greyed in one pass and marked in
|
||
the next.</li>
|
||
<li><strong>Follow</strong> keeps the viewer on the line the run is executing; with it off the view stays where it
|
||
was put.</li>
|
||
</ul>
|
||
<h2 id="what-the-branch-does-not-hold">What the branch does not hold</h2>
|
||
<ul>
|
||
<li><strong>The writeback files are not inside the file nodes.</strong> With <strong>Post-Execution › CL → NC
|
||
Writeback</strong> enabled, the mission re-serializes every file the session played — NC plays as well
|
||
as CL plays — and each converted file makes its own node, labelled <code>→</code> and the output file's
|
||
name, at the top level of the branch, after the file nodes rather than under them; the Program
|
||
panel counts them beside the file count, and clicking a line on either side jumps to its twin on
|
||
the other. With that section disabled the branch shows only source files.</li>
|
||
<li><strong>Node addresses are positions, not files.</strong> A node is <code>execution/program</code> followed by an index
|
||
at each level of nesting — <code>execution/program/0</code> for a top-level file, <code>execution/program/0/0</code>
|
||
for a subprogram nested under it — and a writeback node takes <code>dst-</code> and its own index in place
|
||
of a file index, <code>execution/program/dst-0</code>. So a deep link into the branch survives only as long
|
||
as the branch has the same shape. Link to the branch, not into it.</li>
|
||
<li><strong>A skipped line is not only recorded here.</strong> A line suppressed by block skip is also announced in
|
||
the <strong>NC Diagnostics</strong> list while the run is playing — see
|
||
<a href="when-something-goes-wrong.html">When Something Goes Wrong</a>.</li>
|
||
</ul>
|
||
<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="playing-a-program.html">Playing a Program</a> — the two commands that put the sources here</li>
|
||
<li><a href="when-something-goes-wrong.html">When Something Goes Wrong</a> — reading this branch as part of a diagnosis</li>
|
||
<li><a href="inspecting-a-step.html">Inspecting a Step</a> — the Sentence Syntax panel that a line click on one of these file panels steers</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>
|