Skip to content

M97: Local subprogram call (Haas)

You can call local subprogram or count pieces according to control/manufacturer.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Subprograms
Machine
Milling, Turning, Mill-turn
Risk
Medium
Example
M97 P100

How to write it on each control

Example
M97 P100
Haas
M97 P...

In Haas it usually calls a local subroutine by line number.

Fanuc—

On some lathes it may be assigned to a piece counter or another PLC function.

Parameters

P
N block number of the local subprogram (Haas); on other controls, a counter or function per the manual.
L
Repeats.

Machine: Milling, Turning, Mill-turn

Sources

Other codes in Subprograms

See the full list of G and M codes

Frequently Asked Questions (FAQ)

What does M97 mean in a CNC program?

You can call local subprogram or count pieces according to control/manufacturer. In the catalogue it appears as "Local subprogram call (Haas)", within the Subprograms family.

How is M97 written on each control?

Haas: M97 P.... The exact syntax depends on the control version and the machine parameters: always confirm with the manufacturer's manual.

Can you give me an example of M97?

M97 P100 — You can call local subprogram or count pieces according to control/manufacturer.

Which machines use M97?

M97 is used in: Milling, Turning, Mill-turn.

What should you watch out for with M97?

Medium risk: it rarely breaks anything on its own, but a wrong value shows up on the part. Check the block before running the batch.

Related apps