M97: Local subprogram call (Haas)
What M97 does
M97 is a Haas code that jumps to a sequence number in the same program and returns at M99. Fanuc controls use M98 with a separate program instead.
| Type | M-code |
|---|---|
| Machine | Mill and lathe |
| Group | Program control |
| Modal | No: acts only on its own line |
M97 example
M97 P1000 L2 Run the routine at N1000 twice.
| Word | What it means here |
|---|---|
M97 | Local subprogram call (Haas) |
P1000 | a parameter: dwell time, program number, sequence number or cycle setting, depending on the code |
L2 | repeat count, or which data table G10 writes |
Codes people confuse with M97
| Code | What it does instead |
|---|---|
M98 | Subprogram call. Calls another program as a subprogram. |
Where controls differ
- Haas: Haas specific.
Other codes in the program control group
These also act only on their own line.
Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.
Quick check: M97
-
What does
M97do? (Mill and lathe) -
Which code: On Haas, calls a subprogram at an N line inside the same program.(Mill and lathe)
-
What does
M98do? (Mill and lathe)
Show the answers
- On Haas, calls a subprogram at an N line inside the same program.
- M97
- Calls another program as a subprogram.
Frequently asked questions
- What does M97 mean in CNC programming?
- Local subprogram call (Haas). On Haas, calls a subprogram at an N line inside the same program.
- Is M97 modal?
- No. M97 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
- What is the difference between M97 and M98?
- M97 (local subprogram call (Haas)): on Haas, calls a subprogram at an N line inside the same program. M98 (subprogram call): calls another program as a subprogram.
G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.