Back to GSM Code List

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
E.g.:
M02

Machine: 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

See the full list of G and M codes

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