Haas M-codes28 codesMill
Haas Mill M-code List
Most M-codes on a Haas mill match Fanuc, which is why a Fanuc program usually runs. The table lists the codes the reference marks for a Haas mill, with the Haas meaning where the operator's manual gives another. The exceptions worth learning are M07, the M88 and M89 through-spindle pair, M97 and three settings.
Haas Mill M-code: 28 codes
Codes in colour link to a full page with a worked example and controller differences; the rest link to their row on the M-code list, except codes whose Haas meaning differs from that list, which have no link.
| Code | Function |
|---|---|
| M00 | Program StopUnconditional program stop. Machine stops and waits for operator to press cycle start. Spindle, coolant, and feed are stopped. |
| M01 | Optional StopConditional program stop. Machine stops only if Optional Stop switch is ON. Allows operator to skip stops during production runs. |
| M02 | Program EndEnds the program. Stops spindle, coolant, and feed. Cursor stays at M02 line. Does not rewind program. |
| M03 | Spindle On CWStarts the spindle rotating clockwise (when viewed from above on a vertical mill, or from the tailstock on a lathe). Standard direction for right-hand tooling. |
| M04 | Spindle On CCWStarts the spindle rotating counter-clockwise. Used for left-hand tooling, left-hand tapping, and specific operations. |
| M05 | Spindle StopStops the spindle rotation. Should be called before tool changes and at program end. |
| M06 | Tool ChangeExecutes automatic tool change. Swaps the current tool for the tool specified by the preceding T command. Machine goes through its tool change sequence. |
| M07 | Shower CoolantThe optional shower pump, not mist. M09 turns it off together with the standard coolant. |
| M08 | Flood Coolant OnActivates flood coolant. Standard coolant delivery for most machining operations. Provides cooling, lubrication, and chip evacuation. |
| M09 | Coolant OffTurns off all coolant (both mist and flood). Should be called before tool changes and at program end. |
| M10 | ClampActivates workholding clamp or 4th axis clamp. Specific function varies by machine configuration. |
| M11 | UnclampReleases workholding clamp or 4th axis clamp. Specific function varies by machine configuration. |
| M13 | Release 5th Axis BrakeNot spindle and coolant on. |
| M19 | Spindle OrientationOrients the spindle to a specific angular position and locks it. Required for tool changes with orientation, some boring cycles, and live tooling operations. |
| M21 | Optional User M Function with M-FinA user relay, one of M21 to M28. Not mirror image, which is G100 and G101 on a Haas mill. |
| M22 | Optional User M Function with M-FinA user relay, one of M21 to M28. Not mirror image, which is G100 and G101 on a Haas mill. |
| M23 | Optional User M Function with M-FinA user relay, one of M21 to M28. Not mirror image, which is G100 and G101 on a Haas mill. |
| M30 | Program End and RewindEnds the program and rewinds to the beginning. Stops spindle, coolant, and feed. Standard program ending code. |
| M36 | Pallet Part ReadyNot a part counter. |
| M41 | Low Gear SelectSelects low gear range on machines with gear-driven spindles. Provides higher torque at lower RPM. |
| M42 | High Gear SelectSelects high gear range on machines with gear-driven spindles. Provides higher RPM at lower torque. |
| M48 | Check Validity of Current ProgramNot feedrate override. |
| M49 | Set Status of PalletNot feedrate override. |
| M50 | Execute Pallet ChangeNot pallet clamp. |
| M51 | Set Optional User M CodeM51 to M58 set the user M codes and M61 to M68 clear them. Not pallet unclamp. |
| M97 | Local Subprogram CallCalls a local subprogram within the same program file. Jumps to a block with the specified N number and executes until M99 is encountered, then returns. |
| M98 | Subprogram CallCalls a subprogram. Execution transfers to the subprogram and returns to the next line after M98 completes. |
| M99 | Subprogram ReturnReturns from a subprogram to the calling program. Execution continues at the line after the M98 call. |
Where Haas differs
- M07 is Shower Coolant, the optional shower pump, not mist. M09 stops the shower and the standard coolant together. A post that writes M07 for mist runs the shower pump on a Haas.
- Through-spindle coolant is M88 on and M89 off. M88 goes before the spindle speed command. TSC comes as a 21 bar (300 psi) or a 69 bar (1,000 psi) system.
- M34 and M35 move the P-Cool programmable coolant spigot one position away from and towards home.
- Setting 32, Coolant Override, has three positions: Normal, Ignore (programmed M08 and M88 are ignored and the job runs dry, although the pump still switches on by hand) and Off (an alarm on any attempt to switch coolant on, by hand or from the program).
- M06 stops the spindle and switches coolant off, through-spindle included, before the changer moves. Setting 81, Tool At Power Up, is the tool the changer loads when Power Up/Restart is pressed; at 0 no tool change happens.
- M97 P calls a local subprogram by N number inside the same file, with L as the repeat count, and ends with M99. It is Haas only.
- There is no rigid tapping M-code on the Haas mill list, M29 included, and G84 taps without one, so the M29 a Fanuc post writes ahead of G84 does not belong in a Haas program.
- M13 releases the 5th axis brake and M21 to M28 are optional user M functions with M-Fin, not spindle-and-coolant or mirror image codes; mirror image on a Haas mill is G100 and G101. M36 is Pallet Part Ready, M48 checks the validity of the current program, M49 sets the status of a pallet, M50 executes a pallet change and M51 to M58 set the optional user M codes. There is no M14, M37 or M60 on the Haas mill list.
- Setting 56, M30 Restore Default G, decides whether M30 puts modal G codes back to their defaults, G80 and G54 included, so a program that leans on modal state carrying over runs differently with the setting on and off.
Frequently asked questions
Is M07 mist coolant on a Haas?
No. On a Haas mill M07 is the optional shower coolant. Flood is M08, through-spindle is M88, and M09 turns the shower and the flood off. A program posted for a Fanuc mist output will run the shower pump instead. See M07, M08 and M09: coolant.
Why did my Haas run dry with M08 in the program?
Check Setting 32, Coolant Override. In the Ignore position programmed M08 and M88 are ignored, although the coolant still switches on by hand. In the Off position the same block raises an alarm instead.
What is M97 and why does it not work on a Fanuc?
M97 P calls a block inside the same program by its N number, so a repeated pattern lives in the same file rather than in a separate O program. Fanuc has no M97; the usual Fanuc way is M98 P with a separate subprogram. See M-code list.
Does M06 turn the coolant off on a Haas?
Yes. M06 stops the spindle and switches coolant off, through-spindle included, before the changer moves, so the M08 has to be written again after the change. See M06: tool change.
Other controller lists
Last updated 11 Oct 2026