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:

To open a program:

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 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

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.

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:

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:

RuleKindWhat it finds
S01WarningNo start block before the first move: the program relies on the controller's state
S02WarningNo M2 or M30 at the end
S04ErrorA cutting move before any F
S05WarningThe spindle starts without S, or S outside the spindle's range
S07ErrorA code the controller does not take: expressions, O words, subprograms, G41/G42, G68
S10WarningA rapid below the work's top and deeper than the program has cut
S11ErrorAn arc the controller refuses
S12WarningThe water-cooled spindle cuts without its coolant (M8)
S14WarningA 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.

  1. Put the cursor on the line, or press Alt+↓ and Alt+↑ to go from finding to finding.
  2. 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:

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

  1. 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.
  2. Press Load and check (Ctrl+K) to load it into the machine.

Saving and exporting

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).