Code reference
M30 vs M02: Program End and Rewind Explained
M30 ends the program and rewinds to the top; M02 just ends it on older controls. What each one resets, why the tape history matters, and which to use.
Lawrence Arya··10 min
G-code guides about M99: what the codes do, common mix-ups and practice tips for CNC beginners.
M30 ends the program and rewinds to the top; M02 just ends it on older controls. What each one resets, why the tape history matters, and which to use.
M99 loops programs three ways: at a main program's end for continuous runs, with M98 L-counts for repeats, and with macro counters for controlled cycles.
M98 calls a subprogram and M99 returns from it, letting you reuse a block of code. Here is how the pair works on Fanuc-style controls, with an example.