Documentation User manual
Programs and the editor
The Program workspace (Alt+3) holds your programs and the example parts, an editor that checks a program as you type, and a preview of what the program does to the workpiece. Studio keeps a version of a program each time you save it or load it into the machine, so you can see what changed and go back.
Opening a program
The workspace has three parts:
- on the left, Programs (each program and its versions) and Example parts;
- in the middle, the editor;
- on the right, the 3D preview, Load and check and the program check's findings.
To open a program:
- File > Open program… (Ctrl+O) loads a G-code file into the machine, and into the editor if the editor has no unsaved changes. Studio reads your file and never writes it.
- Dropping one G-code file (.nc, .gcode, .ngc, .tap, .txt, .cnc) anywhere on the window does the same. While a program runs, Studio opens nothing and says so in the console.
- File > Recent programs lists the last eight programs opened from a file, newest first. One that has been moved or deleted since is taken off the list when you pick it; Clear the list empties it.
- File > Print program… (Ctrl+P) prints the program in the machine, its lines numbered, black on white, with its name, the page and the date at the top of each page.
- Double-click a program or a version under Programs: its text goes into the editor. It does not go into the machine until you press Load and check.
The editor and the machine can hold different programs. When the machine has a program you have not opened in the editor, the status line says so: Ctrl+K loads the editor's program into the machine, Ctrl+Shift+R takes the machine's program into the editor (your edits are saved as a version first).
Example programs
Studio 1.0 comes with four example parts: a NEMA 17 motor mount plate, an instrument front panel, a microfluidic droplet chip and an isogrid lightweight panel. More come with updates. Double-click one under Example parts, or choose it from File > Example parts….
Loading an example sets up the whole machine for it: the blank and the fixture, the tool table and the tool in the spindle, homing, the work zero, the program, and the part to compare with when the example has one.
Note
An example replaces the blank, the tool table and the G54 work zero you had. Demo program in the same list loads only the program and leaves the blank as it is.
The editor
The editor is a G-code editor:
- the words are coloured by kind: G and M codes, axes, arc words, feed, speed, tool, comments, expressions;
- the margin shows the line numbers and marks: the check's findings (red errors, amber warnings, blue notes), breakpoints, and the line the machine is running;
- after a run, a second margin shows each line's time in seconds: amber when the feed was not reached, red when something happened there (a rapid into material, a cut with the spindle stopped, a collision, an alarm). Click it for the line's figures from the last run.
The status lines under the editor show the line and column, whether the text is in the machine, the version, the check's counts, and the program's state after the line you are on: the modal codes, the feed, the speed, the tool and the position.
Expand gives the editor the whole workspace; Restore brings back the programs and the preview.
Colours and line numbers
The colours follow the window's look (light or dark). Lines that the controller has already taken ahead of the line being run are grey.
Finding and replacing
- Ctrl+F opens the find box. Enter finds the next match, Shift+Enter the one before. The search ignores case and goes round to the start.
- Ctrl+G goes to a line number.
- Ctrl+H opens the replace box under the find box. Enter replaces the match that is selected and goes to the next; Ctrl+Enter replaces all of them. Ctrl+Z undoes it.
Esc closes the boxes.
Breakpoints and pauses
A breakpoint stops the twin's time when the run gets to that line; the machine's motion does not change. F5 goes on.
- Ctrl+B, or a click in the marks margin, puts a breakpoint on the line.
- Pause on (Ctrl+Shift+B) stops the twin when something happens: the tool starts cutting, a rapid cuts material, a near miss or a collision, chatter, an alarm, a change of the controller's state, the cutting force, the spindle's load or the following error over a limit you choose, or a modal change. When the twin runs in real time, the chatter check is worked out beside the simulation, so a pause on chatter, and the chatter figures in the views, can come a little after the cut: usually a few hundred milliseconds, and a second or two where many new cutting conditions come together (a pocket round islands). Until the check has answered for a tool, the margin reads computing…; the curves and the tool-tip trail wait for each cut's own answer, so they show that cut's margin. The run's report at its end is the same either way.
- The line's menu (right-click in the margin, or Shift+F10) also has Run to line … and Clear all breakpoints and conditions.
Breakpoints take effect once the program is in the machine.
The program check
The editor checks the program as you type (a moment after you stop), when it is loaded, and again after a run. There are two parts:
- the rules check every line against what the controller and the machine take. They need nothing else;
- the preview check runs the program against the workpiece as it is now. It needs the machine powered and homed and no program running. As you type it takes programs of at most 20 000 lines; a longer program is checked in full once it is loaded into the machine, and its problems show as red boxes in the 3D view and in the Messages tab.
Program > Check program is another check: it sends the loaded program through the controller's own check mode, line by line, while the machine does not move.
What the check finds
Each finding is an error, a warning or a note, shown under its line with its rule's number. Examples:
| Rule | Kind | What it finds |
|---|---|---|
| S01 | Warning | No start block before the first move: the program relies on the controller's state |
| S02 | Warning | No M2 or M30 at the end |
| S04 | Error | A cutting move before any F |
| S05 | Warning | The spindle starts without S, or S outside the spindle's range |
| S07 | Error | A code the controller does not take: expressions, O words, subprograms, G41/G42, G68 |
| S10 | Warning | A rapid below the work's top and deeper than the program has cut |
| S11 | Error | An arc the controller refuses |
| S12 | Warning | The water-cooled spindle cuts without its coolant (M8) |
| S14 | Warning | A tool of another length than the one the work zero was set with, and nothing measures it |
The preview check adds what the program would do to the workpiece: rapids into material, cutting with the spindle stopped, collisions with the fixture, moves beyond the travel, and a spindle running dry.
Fixing a finding
Some findings come with a suggestion, for example Suggestion (insert before): M8.
- Put the cursor on the line, or press Alt+↓ and Alt+↑ to go from finding to finding.
- Press Ctrl+. (or choose Apply the suggestion in the line's menu).
Result: the change is made as one step; Ctrl+Z undoes it. Read the suggestion before you apply it: it fixes the finding, not your intent.
Optimizing
Optimize (Ctrl+Shift+O) looks for a faster program that cuts the same part: it changes feeds and speeds, merges short lines and lowers retracts. It runs the original and the optimized program on two hidden copies of the machine, with the same setup. It needs a blank set up. Optimize is in the Pro edition and up.
If the result is better, it replaces the editor's text (Ctrl+Z gives the original back) and the comparison opens. The console gives the times, the highest cutting force and the chatter margin before and after, and what changed. Press Stop optimizing or Ctrl+Shift+O to stop it.
Versions
Studio saves a version of a program when you:
- press Save version (Ctrl+S);
- load it into the machine (Load and check, or File > Open program…);
- optimize it, or take a generated or the machine's program in place of your edits (your edits are saved first).
A version that is the same as the last one is not saved again. Versions are kept in Documents\Twinwright Studio\programs\<program>\, one file each, and are never pruned. Programs lists them under each program, with the time and why each was saved.
Comparing two versions
Compare (Ctrl+D) shows the newest saved version that differs from the editor's text, under the editor: changed lines amber, added green, removed red, and lines where only F or S changed blue. Press Ctrl+D again for an older version, Alt+↓ and Alt+↑ to go from difference to difference, Esc to close.
The heading counts the differences and, when both versions have run to the end in this session, compares their run times.
To compare two saved versions, open the newer one in the editor first, then press Ctrl+D.
Going back to a version
- Under Programs, double-click the version. Result: its text goes into the editor. Your unsaved edits are saved as a version first; Ctrl+Z undoes the change.
- Press Load and check (Ctrl+K) to load it into the machine.
Saving and exporting
- Save version (Ctrl+S) keeps a version in Studio's programs folder.
- Ctrl+Shift+S saves the editor's program as a file wherever you choose.
- A version is a plain
.ncfile: you can copy it from the programs folder.
File > Export curves (CSV)… saves the run's curves (see Analysis and diagnostics). The setup sheet and the inspection report are on the Reports card in Setup (see Inspection).