A Haas counts a part every time a program ends at M30. That works fine when one cycle equals one part. The moment you run a fixture with four parts, or a bar-fed lathe dropping a dozen per cycle, the machine undercounts and every production report built on it is wrong. This guide sets the counters up properly, shows the two floor counters and how to use them, and gives you a clean macro for counting multiple parts per cycle.
How the Haas counts, out of the box
Every time a program reaches M30 (program end), the control bumps two separate part counters: M30 Counter #1 and M30 Counter #2. You’ll find them under Current Commands > Timers And Counters.
Why two? So you can run them for different jobs. A common setup is to use one as a resettable shift or job counter and leave the other as a running lifetime total you never reset.
To reset a counter: cursor to the counter you want to clear and press ORIGIN. That zeroes just that value, so you can wipe the shift counter each morning while the lifetime total keeps climbing.
Looping programs (M99) If your program loops on M99 instead of ending on M30, turn on Setting 118 (M99 Bumps M30 Cntrs) so each loop still counts. One catch worth knowing: M99 only bumps the counter from a main program, not from inside a subprogram.
Counting multiple parts per cycle
Here is the part most shops get wrong. If one program cycle makes four parts but ends on a single M30, the counter goes up by one, not four. Your machine says 100 when the floor made 400. Every downstream number inherits that error.
The fix takes one line of code. The two M30 counters are stored in system macro variables you can write to directly:
| Macro variable | What it holds |
|---|---|
#3901 | M30 Counter #1 |
#3902 | M30 Counter #2 |
Because M30 already adds one on its own, you add the remaining parts just before it. For a fixture of four parts, add three:
( ... end of your program ... )
#3901 = #3901 + 3 ( fixture of 4: add the other 3 )
#3902 = #3902 + 3 ( keep both counters in step )
M30 ( M30 adds the 4th, counter moves by 4 )
The math is always parts-per-cycle minus one, because M30 supplies the last one. Two parts, add 1. Ten parts, add 9.
When the count changes cycle to cycle
On a bar-fed lathe, the number of parts per cycle can vary. Drive it from a variable instead of a hard number. Say #100 holds how many good parts this cycle made:
#3901 = #3901 + [#100 - 1] ( add this cycle's parts, minus M30's one )
#3902 = #3902 + [#100 - 1]
M30
Always test one cycle After you add the macro, run a single cycle in a safe condition and watch M30 Counter #1 on the Timers And Counters page. It should jump by your full part count, four, not one. Then confirm the same number lands in Spall. Changing how a machine counts is exactly the kind of thing worth proving once before you trust the report.
How the count reaches Spall
Spall reads the machine’s part count over MTConnect, on the same connection you set up in the MTConnect guide. The MTConnect PartCount item reflects the machine’s M30 counter, so once the macro is counting correctly on the control, the corrected number flows straight through, and there’s nothing extra to configure on the Spall side. No separate wiring, no sensor on the fixture.
What Spall does with the count
Production. Spall turns the running count into pieces-per-shift and pieces-per-job against target, updating as the machine works. With the multi-part macro in place, the numbers finally match what shipped.
Quality. Pair the total count with scrap and reject tagging, and Spall separates good parts from total parts. That split feeds the Quality side of OEE instead of pretending every part was a keeper.
Performance. Count plus runtime gives a true per-part cycle time. When it creeps, Spall flags it before it eats a shift of capacity unnoticed.
OEE and dollars. Availability, performance, and quality combine into OEE, with each loss ranked in dollars so the biggest recovery is obvious, not buried in a spreadsheet.
Quick recap
- M30 bumps Counter #1 and #2
- View or reset under Timers And Counters
- ORIGIN zeroes a counter
- Multi-part: add (N minus 1) to
#3901/#3902before M30 - M99 loops need Setting 118 on
- Test one cycle, confirm in Spall
Get the count right on the machine and everything above it gets accurate. That is the whole point, a number the floor believes.