Most Used M Codes for CNC Machinist
M00: Program stop
Stop the program where ever placed
M01: Optional stop
Stop the program were ever placed. Toggled on and off on the control panel.
M02: End of program
M03: Spindle clockwise
Turn spindle on clockwise accompanied with an S value for the speed
M04: Spindle counterclockwise
Turn spindle on counterclockwise accompanied with an S value for the speed
M05: Spindle stop
Stops spindle
M06: Tool change
Mainly used on the mill to change to the desired tool T value.
M07: Spindle coolant on
Through tool spindle, coolant activation can be toggled on the control panel
M08: Flood coolant on
Flood coolant activation can be toggled on the control panel
M09: Coolant off
Turns coolant off can be toggled on the control panel
M19: Spindle lock
Lock spindle in the home position. You won't be able to turn the spindle by hand.
M30: End of program
Ending of the program and return to the top of the program
M98: Sub-program activate
Move to subprogram accompanied by P-value indicating the program number.
M99: Return from sub-program
Go back to main program