M-code reference
M02 M-Code: End of Program
End of Program — Ends the program. Unlike M30 it may not rewind to the top on older controls.
| Property | Value |
|---|---|
| Code | M02 |
| Function | End of Program |
| Used on | Mills and lathes |
What does M02 do?
Ends the program. Unlike M30 it may not rewind to the top on older controls.
M02 example
M05
M02Tips
- M30 is preferred on modern controls.
M-codes vary between machine builders. Codes from M00 to M09, M30 and M98/M99 are nearly universal; most others are defined by the machine builder. Always check the M-code list in your machine manual.
Related codes
Most-used M-codes
| Code | Function |
|---|---|
M00 | Program Stop |
M01 | Optional Stop |
M03 | Spindle On Clockwise |
M04 | Spindle On Counter-Clockwise |
M05 | Spindle Stop |
M06 | Tool Change |
M08 | Flood Coolant On |
M09 | Coolant Off |
M30 | Program End and Rewind |
M98 | Subprogram Call |
M99 | Subprogram Return / Loop |
Frequently asked questions
What does M02 mean on a CNC machine?
M02 is End of Program. Ends the program. Unlike M30 it may not rewind to the top on older controls.