M-code reference

M01: Optional stop

M01 is optional stop. Stops only when the Optional Stop switch is on. It is non-modal, so it acts only on the line it is written on.

What M01 does

M01 behaves like M00, but only if the operator has switched Optional Stop on. Programmers put M01 after each tool so a first part can be checked tool by tool, then the switch is turned off for production.

TypeM-code
MachineMill and lathe
GroupProgram control
ModalNo: acts only on its own line

M01 example

M01

Stop here if Optional Stop is on.

WordWhat it means here
M01Optional stop

Codes people confuse with M01

CodeWhat it does instead
M00 Program stop. Stops the program until the operator presses cycle start.

Other codes in the program control group

These also act only on their own line.

  • M00 Program stop
  • M02 End of program
  • M30 End of program and rewind
  • M97 Local subprogram call (Haas)
  • M98 Subprogram call
  • M99 Subprogram end / return

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: M01

  1. What does M01 do? (Mill and lathe)

  2. Which code: Stops only when the Optional Stop switch is on.(Mill and lathe)

  3. What does M00 do? (Mill and lathe)

Show the answers
  1. Stops only when the Optional Stop switch is on.
  2. M01
  3. Stops the program until the operator presses cycle start.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does M01 mean in CNC programming?
Optional stop. Stops only when the Optional Stop switch is on.
Is M01 modal?
No. M01 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
What is the difference between M01 and M00?
M01 (optional stop): stops only when the Optional Stop switch is on. M00 (program stop): stops the program until the operator presses cycle start.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint