Common vs builder-specific codes
| Function | Commonly | Varies by machine? |
|---|---|---|
| Spindle CW / CCW / stop | M03 / M04 / M05 | Rarely |
| Tool change | M06 | Rarely |
| Flood coolant on / off | M08 / M09 | Rarely |
| Mist coolant | Often M07 | Sometimes |
| Through-spindle coolant | e.g. M88/M89 (Haas) | Yes |
| Air blast | e.g. M83/M84 (Haas) | Yes |
| Rotary clamp / unclamp | e.g. M10/M11 | Yes |
| Chip conveyor, doors, pallet | Builder defined | Yes |
Coolant logic in the post
- Map CAM coolant choices (flood, mist, air, through-tool, combinations) to machine codes.
- Turn coolant off before tool changes, rotary moves or probing.
- Wait for through-spindle pressure before cutting (dwell or builder signal).
- Avoid repeated on/off codes between operations with the same coolant.
Example: through-spindle coolant with pressure delay
T4 M06
G00 G90 G54 X0. Y0. S6000 M03
G43 H04 Z50.
M88 (through-spindle coolant on - Haas code)
G04 P2000 (wait 2 s for pressure - dwell units depend on controller)
G83 X0. Y0. Z-40. R2. Q5. F250.
M-code sequencing
Some controllers allow only one M-code per block, or process multiple M-codes in a particular order. The post outputs M-codes in separate blocks where needed to guarantee the right order.
The machine builder's M-code list is one of the most important documents in any post project.
M-code customisation
See our CNC post processor development service and Haas CNC posts.