FANUC · FOCAS

How to Set Up Multiple Part Counts on FANUC Machines

When one cycle makes several parts, a FANUC control still counts one. Fix the count on the control and Spall reads the right number over FOCAS.

~10 min · Last reviewed August 12, 2026

A FANUC control counts a part each time the program ends at M02 or M30. That’s correct for one part per cycle. Run a fixture with four parts, or a bar job dropping a dozen per cycle, and the control counts one where the floor made four or twelve. Every production and quality number built on that count inherits the error. This guide shows how FANUC counts, the two clean ways to count multiple parts per cycle, and how the corrected number reaches Spall.

How a FANUC counts, out of the box

FANUC keeps its part counters in parameters you can see and set on the control. The important ones:

ParameterWhat it does
6711PARTS COUNT, the running number of machined parts
6712PARTS TOTAL, a lifetime total
6713PARTS REQUIRED, the target for the job
6710The M code that bumps the count
6700#0 (PCM)Counting mode bit. 0: count on M02 / M30 (or the M code in 6710). 1: count only on the M code in 6710.
SETTING (TIMER / COUNTER) FANUC • OFFSET/SETTING PARTS TOTAL18452 PARTS COUNT842 PARTS REQUIRED1000 These map to parameters 6712 / 6711 / 6713 This is the one Spall reads Reset PARTS COUNT to 0 at the start of a job or shift.
The FANUC parts display. PARTS COUNT (parameter 6711) is the live number Spall reads over FOCAS.

With 6700#0 (PCM) = 0, the control bumps PARTS COUNT by one every time it hits M02 or M30. That single “+1” is the whole problem when a cycle makes more than one part.

Counting multiple parts per cycle

The fix lives in the part program, using the FANUC system variable tied to the counter:

System variableWhat it holds
#3901PARTS COUNT (same value as parameter 6711)
#3902PARTS TOTAL (same value as parameter 6712)

Prerequisite Writing to #3901 needs the Custom Macro (Macro B) option enabled on the control. It’s on the vast majority of machines. If your control can’t read or write # variables, that option is missing, your builder or FANUC can turn it on.

Method A: add the extra parts before M30

If you leave automatic counting on (PCM = 0), M30 already adds one. So you add the remaining parts just before it. For a fixture of four, add three:

( ... end of program ... )
#3901 = #3901 + 3   ( fixture of 4: add the other 3 )
M30                 ( M30 adds the 4th, count moves by 4 )

The rule is parts-per-cycle minus one, because M30 supplies the last one. Simple, and it leaves the control’s default behavior alone.

Method B: take full control of the count

Cleaner when the count varies, or when you just want the arithmetic to read plainly. Turn off the automatic M30 bump by setting 6700#0 (PCM) = 1 and pointing parameter 6710 at an M code you never actually run. Now nothing counts on its own, and you add the exact number in the program:

( PCM = 1, so M30 no longer counts on its own )
#3901 = #3901 + 4   ( add exactly this cycle's parts )
M30

When the number changes cycle to cycle, drive it from a variable. Say #100 holds this cycle’s good parts:

#3901 = #3901 + #100   ( bar job: whatever ran this cycle )
M30
PROGRAM O1234 (4-UP FIXTURE) N118G91 G28 Z0. ; N120M09 ; N125( --- part counting --- ) N130#3901 = #3901 + 3 ; N135M30 ; % One line before M30. M30 adds the 4th count itself.
Method A in a four-up program: add three before M30. Edit and save the program on the control as usual.

Always test one cycle After you change how the machine counts, run a single cycle in a safe condition and watch PARTS COUNT on the control. It should jump by your full part count, four, not one. Then confirm the same number shows in Spall. Proving it once beats trusting a report that’s off by 4x and nobody’s checked.

How the count reaches Spall

Spall reads PARTS COUNT (parameter 6711 / #3901) directly over FOCAS, on the same connection from the FOCAS setup guide. Fix the count on the control and the corrected number flows straight through, no extra sensor on the fixture, no separate wiring.

PARTS COUNT +4 / cycle FOCAS :8193 Spall reads param 6711 Production target vs actual Quality good vs total
Fix the count on the machine once, and both the production and quality views in Spall inherit the correct number.

What Spall does with the count

Production. Spall turns PARTS 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. That split feeds the Quality side of OEE instead of assuming every part was a keeper.

Performance. An accurate 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, each loss ranked in dollars so the biggest recovery is obvious instead of buried in a spreadsheet.

Quick recap

  • PARTS COUNT = param 6711 = #3901
  • Needs the Macro B option
  • Method A: add (N minus 1) before M30
  • Method B: PCM=1, then add exactly N
  • Varies by cycle? Add #100
  • Test one cycle, confirm in Spall

Get the count right on the control and everything above it gets accurate. That’s the whole point, a number the floor believes.

Related guides

From the Help Center

$200/machine/mo · pilots from $4,500 · hardware included

See full pricing →

See your FANUC machines live

30 days, hardware included, line pilot $4,500 or plant pilot $8,500, fully credited when you expand.