Counters - Mitsubishi Electric FX2N Beginners Manual

Hide thumbs Also See for FX2N:
Table of Contents
Devices in Detail
4.4

Counters

The programmers of the FX family also have internal counters that you can use for program-
ming counting operations.
Counters count signal pulses that are applied to their inputs by the program. The counter out-
put is switched on when the current counter value reaches the setpoint value defined by the
program. Like timers, counter outputs can also be polled as often as you like in the program.
Example of a program using a counter:
Ladder Diagram
X0
0
X1
3
C0
7
Whenever input X1 is switched on the value of counter C0 is incremented by 1. Output Y0 is set
when X1 has been switched on and off ten times (the counter setpoint is K10).
The signal sequence generated by this program is as follows:
X0
X1
0
Y0
There are two kinds of counters, 16-bit counters and 32-bit counters. As their names indicate,
they can count up to either 16-bit or 32-bit values and they use 16 bits and 32 bits, respectively,
to store their setpoint values. The following table shows the key features of these counters.
FX Beginners Manual
10
9
8
7
6
5
4
3
2
1
RST
C0
K10
C0
Y0
First the counter is reset with input X0 and a
RST instruction. This resets the counter value
to 0 and switches off the counter output.
Once the counter value has reached the set-
point value any additional pulses on input X1
no longer have any effect on the counter.
Instruction List
0
LD
X0
1
RST
C0
3
LD
X1
4
OUT
C0
7
LD
C0
8
OUT
Y0
Counters
K10
4 – 9
Table of Contents
loading

Table of Contents