Haas M-codes22 codesLathe
Haas Lathe M-code List
The Haas lathe list here is shorter than the mill's: stops and ends, spindle and coolant, clamps, the parts catcher, gear ranges and the M97 and M98 subprogram calls. M21 to M23, M29, M50, M51 and M60 are missing because the reference ties them to milling, and M07, M48 and M49 are not on the Haas lathe code list.
Haas Lathe M-code: 22 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. |
| 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 | Air Jet OffNot spindle and coolant on. |
| M14 | Main Spindle ClampNot 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. |
| M30 | Program End and RewindEnds the program and rewinds to the beginning. Stops spindle, coolant, and feed. Standard program ending code. |
| M36 | Parts Catcher OnNot a part counter. |
| M37 | Parts Catcher OffNot 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. |
| 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
- The lathe list drops M21 to M23, M29, M50, M51 and M60 because the reference marks those as mill codes. That is how the app's data is filtered, not a statement about the Haas lathe, where M21 and M22 advance and retract the tailstock, M23 turns on angle out of thread and M51 to M58 set optional user M codes.
- M07 is not on the Haas lathe code list: coolant is M08 on and M09 off. On the mill M07 is the optional shower coolant, not mist.
- M13 is air jet off and M14 main spindle clamp, not spindle-and-coolant codes, and M36 and M37 switch the parts catcher on and off rather than counting parts. M48 and M49 are not on the lathe code list.
- M88 and M89 switch the optional high-pressure coolant on and off.
- Setting 32 governs M08 and M88 on the lathe as well. On the mill Setting 32 is Coolant Override, where Ignore drops programmed coolant commands and Off alarms on them.
- M97 P calls a local subprogram by N number inside the same program, with L as the repeat count. Haas only.
- M41 and M42 are gear overrides: they hold the spindle in low or high gear on machines that have one, where the S word would otherwise pick the gear. The reference lists them for Fanuc, Haas and Mazak and notes that not every machine has a gearbox.
- M19 spindle orientation is on the Haas lathe list as well as the mill's. On the lathe it is an option, with P or R for the angle.
Frequently asked questions
Why are there fewer M-codes on the lathe list than the mill list?
Because the reference marks M21 to M23, M29, M50, M51 and M60 as milling codes, so the lathe filter leaves them out. On a Haas lathe M21 to M23 are tailstock and threading codes instead. M07, M48 and M49 are left out as well, because the Haas lathe code list does not have them. The Haas mill M-code list has the rest.
Is M07 mist coolant on a Haas lathe?
No. M07 is not on the Haas lathe code list at all: M08 is coolant on, M09 is coolant off, and M88 and M89 switch the optional high-pressure coolant. On a Haas mill M07 is the optional shower coolant, not mist. See M07, M08 and M09: coolant.
How do I repeat a section of the program on a Haas lathe?
M97 P with the N number of the block to jump to and L for the repeat count, ending the section with M99. On a Fanuc lathe the usual way is M98 P and a separate subprogram. See M-code list.
Other controller lists
Last updated 11 Oct 2026