+86 0769 86066062 info@kehuimold.com

CNC Turning M-Codes List

CNC Turning M-Codes

1. Program Control

M-Code Function Example Notes
M00 Program Stop (Manual Resume) M00 (Inspection) Requires “Cycle Start” to continue
M01 Optional Stop (Panel Confirm) M01 (Batch Sampling) Needs “Optional Stop” enabled
M02 Program End (No Reset) M02 (Legacy Program End) Use M30 instead in modern CNCs
M30 Program End & Reset M30 (Standard Program End) Returns to program start
M98 Subprogram Call M98 P1001 (Calls O1001) Subprogram number after P
M99 Subprogram End/Return M99 (End of Subprogram) Can force jump (e.g., M99 P200)

2. Spindle Control

M03 Spindle CW (Forward) S2000 M03 (2000 RPM CW) Always specify speed (S)
M04 Spindle CCW (Reverse) S1500 M04 (1500 RPM CCW) Used for tapping/left-hand threads
M05 Spindle Stop M05 (Before Tool Change) Mandatory safety command
M19 Spindle Orientation M19 (Tool Change Alignment) Aligns spindle keyway
M29 Rigid Tapping Mode M29 S500 (Rigid Tap at 500 RPM) Requires spindle encoder

3. Coolant Control

M07 Mist Coolant (MQL) M07 (Minimum Quantity Lubrication) For finishing
M08 Flood Coolant M08 (Standard Cutting) Most common coolant command
M09 Coolant Off M09 (Before Program End) Prevents leakage

4. Automatic Tool Change (ATC)

M06 Tool Change T02 M06 (Changes to Tool 2) Requires M05 first
M60 Pallet Change (APC) M60 (For Horizontal Mills) Machine-specific

5. Special Functions

M21-M28 Mirror Imaging (X/Y/Z) M21 (X-Axis Mirror) For symmetrical parts
M48/M49 Feed Override Cancel/Enable M49 (Locks 100% Feedrate) Ensures consistent cuts
M52 Tailstock Advance (Mill-Turn) M52 (Lathe Mode) For mill-turn machines
M53 Tailstock Retract (Mill-Turn) M53 (Milling Mode) For mill-turn machines

6. Machine Status Control

M07 Mist Coolant (MQL) M07 (Fine Finishing) Low-quantity lubrication
M08 Flood Coolant M08 (General Machining) Default coolant mode
M09 Coolant Off M09 (Program End) Mandatory before shutdown

Factory Overview

Latest Post

Mold Materials
Injection Mold Materials Commonly Used in the Automotive Industry
Plastic Injection Mold
5 Points To Extend The Service Life Of Plastic Injection Mold
Injection Mold
How To Optimize Injection Mold To Reduce Production Cycles?
Mold Supplier
How To Choose The Right Mold Supplier In The Automotive Industry?

Call

+86-0769-86066062

Email

info@kehuimold.com

Service Time

9:00 AM – 10:00 PM