Table of Contents

Playing a Program

Two commands put a program into a mission, and the difference between them is where the program lives rather than what it does: Program File references a file on disk, NC Code carries the text inside the project.

Where they are

Mission, the first root of the Execution page's Control Tree. Both sit in the Program category of Add Command, the + on the Mission row or on a List row, and both are placed like any other command — see Building a Mission.

Which one to use

  • Program File — 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.
  • NC Code — 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.

They do not necessarily feed the same reader. 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.

Program File

Point it at a program

Type the path, or press Browse. Both forms are accepted: a path relative to the project folder, which is what browsing produces, or an absolute path on the server.

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.

The dialog filters in four groups rather than one:

Group Extensions
NC Files .nc, .anc, .tap, .eia, .mpf, .spf, .cnc, .ptp, .h — the common brand extensions, not all of them
CL Files .cl, .cls, .clsf
CSV Files .csv
All Files everything, and the backstop for a brand extension the first group does not name

The picker takes more than one file. The first goes on the command you opened it from; every further pick becomes a new Program File command placed directly after it, in the order you picked them, inside the same list — including inside a nested List. That is the quick way to bring a folder of CAM output into a mission.

Choose the reader

Play As decides which reader plays the file:

Choice What plays it
Auto (by extension) Picked from the extension: .cl, .cls and .clsf play as CL, .csv as CSV, and every other extension as brand NC
Brand NC The controller brand's own reader
CL (CLSF) The NX-CL reader
CSV The CSV reader

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 .txt, say.

For brand NC, which brand is not this command's business: it is the controller set on the project, and what its words mean is NC Dialects.

Read the banner

Once the field holds a path, a banner below it reports what the server can see:

  • Found — a green banner with the file's size, its modified time and its line count, and a Preview button that shows the first 100 lines read-only.
  • Not found — an orange banner saying so, and no Preview button.

Typing saves the path as you type; the banner refreshes when you leave the field or press Enter. 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.

The first Program File in the demo mission's List [Roughing], at /execution?tree=execution/mission/2/0, selected in the tree under the run header with its move, duplicate and delete buttons revealed. The path field carries a project-relative path, Play As reads Auto (by extension), and the green banner below reports the file's size, modified time and line count with Preview beside it. The tree row and the panel's header both read Program File followed by the path in brackets, which is how a mission of several programs stays readable.

The Execution page's Control Tree with the six transport buttons and a green ready badge above the tree; the Mission root row carries a + at its right edge, and under it Machining Resolution 1 mm, Collision Detection On, then List Roughing expanded with its own + over a selected Program File NC/circle.ptp row showing its move up, move down, duplicate and delete buttons and a Program File NC/drill_slot.ptp row, a collapsed List Finishing with a +, Program File NC/circle.ptp, NC Code Inline finishing pass, a greyed Program File NC/slide-test-resolution-script.ptp with its checkbox cleared, NC Optimization Config expanded over Distances, Feedrate, Motion Dynamics, Force & Safety and Compensation, and a greyed Post-Execution with its checkbox cleared over a child row cut off at the tree's bottom edge, every command row with a checkbox and a drag handle; the panel below is headed Mission / List [Roughing] / Program File [NC/circle.ptp] and holds a Program File Path field reading NC/circle.ptp with a Browse button, a Play As select reading Auto (by extension), and a green banner reading 298 B, modified 2024-09-05 10:38:37, 21 lines with a Preview button

NC Code

Name it

Title 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 command's row in the Control Tree brackets. A new command arrives with NC Code already in the field; rename it and both the log and the row follow.

Write it

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.

Two buttons act on the whole text, and both are disabled while it is empty:

  • Trim Blank Lines — trims every line and drops the ones left empty.
  • Clear — empties the text, after asking.

Typing saves on its own, shortly after you stop; the two buttons save at once.

Nothing is checked while you type. The text is stored exactly as written, and a mistake in it surfaces when the mission plays it — in NC Diagnostics, see When Something Goes Wrong.

The demo mission's short hand-written pass, at /execution?tree=execution/mission/5, selected in the tree as NC Code [Inline finishing pass]. The title above the editor is what that row brackets, and the editor holds the whole program, the closing % of which is cut off at the bottom edge; the counts and the two buttons sit beneath it, past the bottom of this view.

The Execution page's Control Tree with the six transport buttons and a green ready badge above the tree; the Mission root row carries a + at its right edge, List Roughing and the collapsed List Finishing carry their own +, and the NC Code Inline finishing pass row is selected with its move up, move down, duplicate and delete buttons revealed, the greyed Post-Execution at the bottom over a child row cut off at the tree's bottom edge, every command row with a checkbox and a drag handle; the panel below is headed Mission / NC Code [Inline finishing pass] and holds a Title (optional) field reading Inline finishing pass above a monospace NC Code text area whose program runs from a % line through N0010 to N0170 M30 and a closing % cut off at the bottom edge, the text area reaching the bottom edge of the panel

After it has played

Every program a session read appears under the Program 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 The Program Branch.

See Also