Programming of CNC Machines, Third Edition

Miscellaneous function or "M-Codes," control the working components that activate and deactivate coolant flow, spindle rotation, the direction of the spindle rotation and similar activities.
| Code | Function |
|---|---|
| M00 | Program Stop |
| M01 | Optional Stop |
| M02 | Program End Without Rewind |
| M03 | Spindle ON Clockwise (CW) Rotation |
| M04 | Spindle ON Counterclockwise (CCW) Rotation |
| M05 | Spindle OFF Rotation Stop |
| M06 | Tool Change |
| M07 | Mist Coolant ON |
| M08 | Flood Coolant ON |
| M09 | Coolant OFF |
| M10 | Work Table Rotation Locked |
| M11 | Work Table Rotation Unlocked |
| M13 | Spindle ON Clockwise and Coolant ON, Dual Command |
| M14 | Spindle ON Counterclockwise and Coolant ON, Dual Command |
| M16 | Change of Heavy Tools |
| M19 | Spindle Orientation |
| M21 | Mirror Image in the Direction of the X Axis |
| M22 | Mirror Image in the Direction of the Y Axis |
| M23 | Cancellation of the Mirror Image |
| M30 | Program End with Rewind |
| M98 | Subprogram Call |
| M99 | Return to Main Program from Subprogram |