OmniTurn   CNC Lathes Made in Oregon
 Fast... Precise... Affordable... Home Contact

M30, End Program: Cancel all active M-functions (M30)
M02, End Program: Do not cancel m-functions (M02)

One of these commands must be the last line of your program.

M30 End Program: Cancel all active M-functions
When the control encounters the M30 it will stop, reset all active M-codes, and return to the beginning of the program. Coolant (M08), and spindle (M03 or M04), for example, will stop. If you want the coolant to stay on, for example, in cycle repeat mode use M02 instead of M30 to end your program.


M02 End Program: Do not cancel active M-functions
When the control encounters the M02, is will stop and return to the beginning of the program, but the coolant and spindle will continue to run.


Back to G-Codes