Haas M-codes
Haas M-Codes for Mill and Lathe
Miscellaneous functions switch things on and off: spindle, coolant, doors, chucks, conveyors and subprograms. Many are options — if your machine does not have the hardware, the code will alarm.
Haas mill M-codes
| Code | Description |
|---|---|
M00 | Program stop |
M01 | Optional program stop |
M02 | Program end |
M03 | Spindle on, forward (CW) |
M04 | Spindle on, reverse (CCW) |
M05 | Spindle stop |
M06 | Tool change |
M07 | Shower coolant on (option) |
M08 | Coolant on |
M09 | Coolant off |
M10 | 4th axis brake engage |
M11 | 4th axis brake release |
M12 | 5th axis brake engage |
M13 | 5th axis brake release |
M16 | Tool change (same as M06) |
M19 | Orient spindle |
M30 | Program end and reset |
M31 | Chip conveyor forward |
M33 | Chip conveyor stop |
M34 | Coolant spigot increment |
M35 | Coolant spigot decrement |
M41 | Low gear override |
M42 | High gear override |
M46 | Jump if pallet loaded |
M50 | Execute pallet change |
M59 | Set output relay |
M69 | Clear output relay |
M80 | Automatic door open |
M81 | Automatic door close |
M83 | Auto air gun on |
M84 | Auto air gun off |
M86 | Tool clamp |
M88 | Through-spindle coolant on |
M89 | Through-spindle coolant off |
M95 | Sleep mode |
M96 | Jump if no input |
M97 | Local subprogram call |
M98 | Subprogram call |
M99 | Subprogram return or loop |
M109 | Interactive user input |
Haas lathe M-codes
| Code | Description |
|---|---|
M00 | Program stop |
M01 | Optional program stop |
M02 | Program end |
M03 | Spindle forward |
M04 | Spindle reverse |
M05 | Spindle stop |
M08 | Coolant on |
M09 | Coolant off |
M10 | Chuck clamp |
M11 | Chuck unclamp |
M12 | Auto air jet on |
M13 | Auto air jet off |
M14 | Main spindle clamp |
M15 | Main spindle unclamp |
M19 | Orient spindle |
M21 | Tailstock advance |
M22 | Tailstock retract |
M23 | Chamfer out of thread on |
M24 | Chamfer out of thread off |
M30 | Program end and reset |
M31 | Chip auger forward |
M33 | Chip auger stop |
M36 | Parts catcher on |
M37 | Parts catcher off |
M41 | Low gear |
M42 | High gear |
M59 | Set output relay |
M69 | Clear output relay |
M85 | Automatic door open |
M86 | Automatic door close |
M88 | High-pressure coolant on |
M89 | High-pressure coolant off |
M95 | Sleep mode |
M97 | Local subprogram call |
M98 | Subprogram call |
M99 | Subprogram return or loop |
M110 | Secondary spindle chuck clamp |
M111 | Secondary spindle chuck unclamp |
M133 | Live tool forward |
M134 | Live tool reverse |
M135 | Live tool stop |
M143 | Secondary spindle forward |
M144 | Secondary spindle reverse |
M145 | Secondary spindle stop |
M154 | C axis engage |
M155 | C axis disengage |
Subprograms: M97 vs M98 vs M99
M97 jumps to an N block inside the current program and M99 returns from it — ideal for repeated hole patterns. M98 calls a separate O-number program. M99 at the end of a main program loops back to the top, which is how bar-fed lathe jobs run continuously.
O01000 (MAIN)
G00 G90 G54 X0. Y0.
M97 P100 L1 (call local sub at N100)
G55
M97 P100 L1
M30
N100 (HOLE PATTERN SUB)
G81 G99 X1. Y1. Z-0.25 R0.1 F10.
X2.
G80
M99M-code questions
What is the difference between M30 and M02 on a Haas?
Both end the program. M30 also resets to the top of the program and is the normal way to end a Haas program.
What is the difference between M97 and M98?
M97 calls a subprogram inside the same program using an N block number. M98 calls a separate program by its O number.
What does M01 do?
M01 stops the program only when Optional Stop is switched on at the control. It is used to check parts or tools during prove-out.
How do I turn on coolant on a Haas?
M08 turns flood coolant on and M09 turns it off. Through-spindle coolant on a mill is M88 / M89.
Independent reference. Not affiliated with, sponsored by or endorsed by Haas Automation, Inc. Haas is a trademark of its respective owner. Always confirm codes against your machine's operator manual — options and settings vary by model and software version.