The counter in FANUC PLC ladder

Counters are used in Fanuc PLC ladder programs to count the sequences or events. There are many applications of counters in Fanuc PLC. For example, we use counters to know tool positions of ATC in the VMC machine, we get to know that the current tool and next tool to be called, these things we can do using counter instructions.

Here we use data such as preset value and count value to count the sequence of events. Assume that our preset value is set to 10 and counter starts counting from 1,2, 3,4…and then when the count value reaches a preset value (preset value is also known as current value) 10, then counter output bit gets ON. These values will be in BCD (Binary Coded Decimal) format or binary format. The value range for preset and current value will be 0 to 32767 for binary counter and 0 to 9999 for the BCD counter.

Functions of counters:

1. The counter output bit will get ON when the current value reaches the preset value and this preset value can be set on a counter screen or PLC ladder program.

2. The counter will give you a feature that you can choose counting value start from 0 or 1.

3. Counters can be used as a ring counter, means upon reaching preset value; count can be returned to an initial value by another count signal.

4. Counters are counted in up or down sequence.

Types of counters:

There are total four types of counters as shown below table:

PLC counter instructionName
CTRCounter
CTRBFixed counter
CTRCCounter bytes
CTRDCounter two bytes

How the counter will work?

Refer to Picture 1, it shows basic counter PLC instruction. You can see parameters such as CNO, UP-DOWN, RST and ACT are used to set beginning count number, is counter up or down, counter reset, and activating counter instruction respectively. That’s why to enable these parameters smoothly; we use first contact and second contact of output coil address R50.0

PICTURE 1

You can select count value starting from ‘0’ and ‘1’, by sending value 0 or 1 to parameter CNO. You can do this by using first contact or second contact of output coil address R50.0. In Picture 1, we used first contact Read (NO) of R50.0; this will make the counter starts counting from value 1.

When the status of input R50.0, 1The counter begins counting value 0
When the status of input R50.0, 0The counter begins counting value 1

You can choose counter should start in up count or down count by sending value 0 or 1 to parameter UPD. You can do this by using first contact or second contact of output coil address R50.0. In Picture 1, we used first contact Read. Not (NC) of R50.0; this will make the counter starts counting in up direction count.

When status of input R50.0, 1The counter begins counting in down direction
When status of input R50.0, 0The counter begins counting in up direction depends on 1 or 0 (if CNO=1 or 0)

When you send 1 to RST, the counter current value will be reset to 0 or 1 (depends on CNO status 0 or 1)

When you press, X1.4 button, the counter will count one value, next if you press the second time, it will count another one.

Counter operating screen:

As shown in Picture 1, we used number 1 in counter instruction. It means the counter preset address for this PLC counter is C0000 as shown in Picture 2. We need to set preset value for the counter in this address and counter address C0002 is cumulative (current counting value) address. We can check count value in this address C0002.

PICTURE 2
Counter Number in PLC InstructionRespective counter address on CNC display
(Refer to Picture 2)
1C0000
2C0004
3C0008
4C0012
5C0016
6C0020
7C0024
8C0028
9C0032
10C0034

Counter data types:

Data typeThe maximum value for PresetThe maximum value for Current
BINARY3276732767
BCD99999999

Leave a comment