M-code reference
M97 M-Code: Local Subprogram Call (Haas)
Local Subprogram Call (Haas) — Haas: calls a subprogram located inside the same program by its N number. M99 returns. L sets repeats.
| Property | Value |
|---|---|
| Code | M97 |
| Function | Local Subprogram Call (Haas) |
| Used on | Mills and lathes |
What does M97 do?
Haas: calls a subprogram located inside the same program by its N number. M99 returns. L sets repeats.
M97 example
M97 P1000 L3
M30
N1000 (subroutine)
G91 G01 Z-1.0 F200.
G90
M99Tips
- Fanuc does not support M97; use M98 with a separate O number.
M-codes vary between machine builders. Codes from M00 to M09, M30 and M98/M99 are nearly universal; most others are defined by the machine builder. Always check the M-code list in your machine manual.
Related codes
Most-used M-codes
| Code | Function |
|---|---|
M00 | Program Stop |
M01 | Optional Stop |
M03 | Spindle On Clockwise |
M04 | Spindle On Counter-Clockwise |
M05 | Spindle Stop |
M06 | Tool Change |
M08 | Flood Coolant On |
M09 | Coolant Off |
M30 | Program End and Rewind |
M98 | Subprogram Call |
M99 | Subprogram Return / Loop |
Frequently asked questions
What does M97 mean on a CNC machine?
M97 is Local Subprogram Call (Haas). Haas: calls a subprogram located inside the same program by its N number. M99 returns. L sets repeats.