Skip to content

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.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Auxiliary
Machine
Milling, Turning, Mill-turn, Laser/cut
Risk
Low
Example
M02

How to write it on each control

Example
M02
ISO común
M02

The exact behavior depends on the control.

Fanuc—

M30 is usually more common for end and rewind.

Machine: Milling, Turning, Mill-turn, Laser/cut

Sources

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 apps