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

The Execution page's Mission branch. Both sit in the Program category of Add Command, 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 group. 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 Roughing group, at /execution?tree=execution/mission/2/0. The path field carries a project-relative path, Play As reads Auto, and the green banner below reports the file's size, modified time and line count with Preview beside it. The row and the tree label both read Program File followed by the path, which is how a mission of several programs stays readable.

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

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 mission row 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. 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.

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

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