M02: End of program
Ends the program without necessarily rewinding or resetting just like M30.
For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.
- Family
- Auxiliary
- Machine
- Milling, Turning, Mill-turn, Laser/cut
- Risk
- Low
- Example
- M02
M02Machine: Milling, Turning, Mill-turn, Laser/cutRisk: Low
ISO común
M02- The exact behavior depends on the control.
Fanuc
- M30 is usually more common for end and rewind.
Other codes in Auxiliary
Frequently Asked Questions (FAQ)
What does M02 mean in a CNC program?
Ends the program without necessarily rewinding or resetting just like M30. In the catalogue it appears as "End of program", within the Auxiliary family.
How is M02 written on each control?
ISO común: M02. The exact syntax depends on the control version and the machine parameters: always confirm with the manufacturer's manual.
Can you give me an example of M02?
M02 — Ends the program without necessarily rewinding or resetting just like M30.
Which machines use M02?
M02 is used in: Milling, Turning, Mill-turn, Laser/cut.
What should you watch out for with M02?
Low risk: it is a state instruction that rarely causes damage on its own, although it is worth writing it out so you do not depend on the machine's previous state.
Related tools
CNC G-code Simulator
CNC IDE: editing with G/M tooltips, line inspector, conversion between controls and 2D/3D toolpath.
CNC Alarms Guide
CNC Alarms and Solutions Guide. Enter the error code or symptom to find the cause and how to repair it at the machine.
Calculate cycle time
Estimate CNC turning and milling cycle time from G-code. Calculate parts per hour with a breakdown of cutting, rapids, canned cycles and tool changes.