Skip to main content

Haas Part Count

This section applies to both Classic Serial and NextGen controls.

Default — Single Cycle​

By default, a Haas CNC increments the part count when it reaches M30. This is most common on milling machines or single-spindle lathes.

Under Assets → Machines → [machine] → Edit → Data Rules, select the part option Haas M30-Counter, which tells the system to use only M30 Counter #1. Without this setting, you may get a double count.

Continuous Looping Programs with M99​

Where programs loop with an M99 and a part is made each loop, you can enable the CNC to count on M99 by enabling Setting 118.

warning

Enabling Setting 118 can cause unwanted counts when using some programs.

You can also write directly to the counter using a system variable macro. This updates the counter on the home screen:

#3901=#3901+1
M99

Intermittent Looping Programs and then M30​

In scenarios where a program loops and then stops — such as a bar puller cycle — you only want the machine to count each loop, not on the M30. Use a macro variable to avoid an extra count on M30.

Put the following code before the M99:

#500=#500+1
M99
note

Variable #500 is used as an example. Use a spare general-purpose variable: #500–#549, #600–#699, or #800–#999. Avoid #550–#599 (probe calibration data) and #700–#749 (hidden, internal use only) — writing to these can overwrite control calibration or reserved state. See Macro Variables for the full map.

Multiple Parts Per Cycle​

When more than one part is made per cycle, use a macro variable and increment it by the number of parts produced per cycle. For example, if 5 parts are made per cycle:

#500=#500+5
M30

To learn about how to read Haas macro variables into the MachineMetrics adapter, see Configure Macro Variables in Adapter.