To stop a running program temporarily, regardless of the optional stop switch setting, program: M00

To stop a running program temporarily, but only if the optional stop switch is on, program: M01

It’s okay to program M00 and M01 in MDI mode, but the effect probably won’t be noticeable because normal behavior in MDI mode is to stop after each line of input.

If a program is stopped by an M00, M01, selecting Cycle Start restarts the program at the following line of the G-code program.

To end a program, program: M02 or M30.

M02 leaves the next line to be executed as the M02 line. M30 rewinds the G-code file. These commands can have the following effects:

  • Axis offsets are set to zero (like G92.2) and origin offsets are set to the default (like G54)
  • Selected plane is set to XY (like G17)
  • Distance mode is set to absolute (like G90)
  • Feed rate mode is set to units per minute mode (like G94)
  • Feed and speed overrides are set to on (like M48)
  • Cutter Compensation is turned off (like G40)
  • The spindle is stopped (like M05)
  • The current motion mode is set to G01 (like G01)
  • Coolant is turned off (like M09)

No more lines of code in the file are executed after the M02 or M30 command is executed. Selecting Cycle Start starts the program back at the beginning of the file.