Heidenhain M-codes – reference table
Complete reference table of Heidenhain TNC M-codes from M00 to M204, including TCPM (M128), machine-based coordinates (M91/M92) and feed per revolution (M136).
M-codes – called miscellaneous functions on Heidenhain controls – switch machine functions such as the spindle, coolant, and program run. Some of them are machine-dependent and defined by the machine tool builder; the manual of your specific TNC control describes their exact behavior.
Essential M-codes
These are the M-codes you will use most often in day-to-day work on a Heidenhain control.
| Code | Description |
|---|---|
| M03 | Spindle ON clockwise |
| M05 | Spindle STOP |
| M08 | Coolant ON |
| M09 | Coolant OFF |
| M30 | Same function as M02 (end of program) |
| M91 | In the positioning block: coordinates refer to the machine zero point |
| M92 | In the positioning block: coordinates refer to a position defined by the machine manufacturer, e.g. the tool change position |
| M94 | Reduce the rotary axis display to a value below 360° |
| M99 | Blockwise cycle call |
| M116 | Feed rate for rotary axes in mm/min |
| M126 | Shortest-path traverse of rotary axes |
| M128 | Maintain the position of the tool tip when positioning tilting axes (TCPM) |
| M129 | Reset M128 |
| M130 | In the positioning block: points refer to the untilted coordinate system |
| M136 | Feed rate F in millimeters per spindle revolution |
| M137 | Reset M136 |
| M140 | Retract from the contour in the tool axis direction |
| M150 | Suppress limit switch message |
Full reference
All M-codes at a glance, sorted by number.
| Code | Description |
|---|---|
| M00 | Program STOP / spindle STOP / coolant OFF |
| M01 | Optional program STOP |
| M02 | Program STOP / spindle STOP / coolant OFF / clear the status display if configured (depends on machine parameter) / return to block 1 |
| M03 | Spindle ON clockwise |
| M04 | Spindle ON counterclockwise |
| M05 | Spindle STOP |
| M06 | Tool change / program STOP (machine-dependent function) / spindle STOP |
| M08 | Coolant ON |
| M09 | Coolant OFF |
| M13 | Spindle ON clockwise / coolant ON |
| M14 | Spindle ON counterclockwise / coolant ON |
| M30 | Same function as M02 |
| M89 | Free miscellaneous function or cycle call, modally effective (machine-dependent function) |
| M91 | In the positioning block: coordinates refer to the machine zero point |
| M92 | In the positioning block: coordinates refer to a position defined by the machine manufacturer, e.g. the tool change position |
| M94 | Reduce the rotary axis display to a value below 360° |
| M97 | Machine small contour steps |
| M98 | Machine open contours completely |
| M99 | Blockwise cycle call |
| M101 | Automatic tool change with a replacement tool when the maximum tool life has expired |
| M102 | Reset M101 |
| M107 | Suppress the error message for replacement tools with oversize |
| M108 | Reset M107 |
| M109 | Constant contouring speed at the tool cutting edge (feed rate increase and reduction) |
| M110 | Constant contouring speed at the tool cutting edge (feed rate reduction only) |
| M111 | Reset M109/M110 |
| M116 | Feed rate for rotary axes in mm/min |
| M117 | Reset M116 |
| M118 | Superimpose handwheel positioning during program run |
| M120 | Pre-calculate the radius-compensated contour (LOOK AHEAD) |
| M126 | Shortest-path traverse of rotary axes |
| M127 | Reset M126 |
| M128 | Maintain the position of the tool tip when positioning tilting axes (TCPM) |
| M129 | Reset M128 |
| M130 | In the positioning block: points refer to the untilted coordinate system |
| M136 | Feed rate F in millimeters per spindle revolution |
| M137 | Reset M136 |
| M138 | Selection of tilting axes |
| M140 | Retract from the contour in the tool axis direction |
| M141 | Suppress touch probe monitoring |
| M143 | Delete basic rotation |
| M144 | Compensate the machine kinematics in ACTUAL/NOMINAL positions at the end of the block |
| M145 | Reset M144 |
| M148 | Automatically retract the tool from the contour at an NC stop |
| M149 | Reset M148 |
| M150 | Suppress limit switch message |
| M197 | Round corners |
| M200–M204 | Laser cutting functions |