← back to pin list

Subprogram

kerfmaster pin list · Definitions

rulingclosed d13A decision by Aristide or Jordan. True because it was decided; it can be superseded, but it cannot be stale.

Content last changed 2026-08-04 — computed from the item itself, not typed.

Vocabulary — Post stage

⚠ Known defects

This item's subject has a known defect in the code. Source: cadmaster/defects.jsoncadmaster/KNOWN_DEFECTS.md, not this page — the text below is generated from the register so the two can never disagree.

Jordan, 2026-08-04, asked directly because the word was blocking a fix: "A subprogram will be made from a dxf file, using the same gcode multiple times repeated throughout a nest. (A single gcode can contain the same string multiple times. Example, if we want to draw a circle 100 times on the same sheet, we'd have 1 main program calling out 1 subprogram 100 times.)"

So a subprogram is one part — the whole of a part's cut, all its features, authored once from one DXF. The main program is the sheet: it calls that subprogram once per instance in the nest. This is not the same thing as the pierce subprograms (O9011 and the rest of the 9-series), which are Mitsubishi firmware we call but never author.

Why the definition mattered

It resolves what fires M121. Jordan's rule is "M121 at the end of every subprogram", which now reads: at the end of every part, not at the end of every feature and not once per sheet. Against the master NC that is consistent — one part, 91 boundaries, the last of them ending M121 where the other 90 end M87. A 100-up nest of that part would carry 100 M121s, one per call. See defect D13.

What we do today, stated plainly

cadmaster has no part-level subprogram. Every boundary is written inline into one main program; the only M98 we emit is the pierce call. That is correct for a single part and it is what the master does, but it is not the structure a nest needs. When nesting is built (item 3), the post has to learn to emit a part once and call it N times — and the natural mechanism for placing each call is the work shift, G52, which is the same command we currently use for the 0.2 margin. Not built, not designed, recorded here so the shape is known before anyone starts.

Jordan's decision on when — 2026-08-04

Both structural questions were put to him: should a single part be emitted as a real subprogram even when it is called once, and is G52 the mechanism that positions each call on the sheet. The same answer to both: "Keep it this way for now, and we'll learn more about subprograms and nesting later."

So the inline structure stands, and this is a deliberate hold rather than an oversight. The consequence for D13 is that its fix is the small one: with everything inline, the subprogram is the program, so M121 goes on the last boundary and M87 on every other. No restructuring rides along with the M-code fix.