Pro codes · Fanuc

#3901 / #3902 — Parts counter (Fanuc)

Parts counter. #3901 is the number of machined parts and #3902 the required parts, the same values as on the setting page. A macro can stop the machine when the batch is complete, or…

By cnccode · Updated
On this page
  1. What it does
  2. Example
  3. More: macro and system variables
  4. Frequently asked questions
PropertyValue
Code#3901 / #3902
ControlFanuc
TopicMacro and system variables
Syntax#3901 machined · #3902 required

What it does

#3901 is the number of machined parts and #3902 the required parts, the same values as on the setting page. A macro can stop the machine when the batch is complete, or count only good parts. The M-code that counts parts is set in parameter 6710.

Example

Fanuc
IF [#3901 GE #3902] THEN #3000 = 10 (BATCH COMPLETE)
M30

Options, numbers and parameters depend on the control model, the software version and the options the machine builder installed. Check the operator and parameter manual of your machine before you use a code for the first time, and run it in single block with low overrides.

Try it without a machine

The Macro B simulator runs variables, G65 calls, #3000 alarms, G10 and system variables block by block.

Open the Macro B simulator

More: macro and system variables

Frequently asked questions

What is #3901 / #3902 on Fanuc?
Parts counter. #3901 is the number of machined parts and #3902 the required parts, the same values as on the setting page. A macro can stop the machine when the batch is complete, or count only good parts. The M-code that counts parts is set in parameter 6710.
Was this page helpful?