7: BASIC INSTRUCTIONS
7-18 USER’S MANUAL
CNT (Counter)
Three types of counters are available; dual-pulse reversible counter CNT0, up/down selection reversible counter CNT1,
and adding (up) counters CNT2 through CNT31. A total of 32 timers and counters can be programmed in the standard pro-
cessing mode. Each counter must be allocated to a unique number 0 through 31, and the same number cannot be used for
timers. In the high-speed processing mode, counter numbers 0 through 15 are available. For the high-speed processing
mode, see page 4-1.
Dual-Pulse Reversible Counter CNT0
The dual-pulse reversible counter CNT0 has up and down pulse inputs, so that three inputs are required. The circuit for a
dual-pulse reversible counter must be programmed in the following order: preset input, up-pulse input, down-pulse input,
and the CNT0 instruction, followed by the counter preset value from 0 to 9999.
The preset value can be designated using a decimal constant or a data register. When a data register is used, the data of the
data register becomes the preset value. If the data register designated as a counter preset value holds a value over 9999, a user
program execution error will result, then the error indicator, ERR1, is lit, and the special internal relay, M304, turns on. Data
registers D0 through D99 are available in the standard processing mode and D0 through D31 in the high-speed processing
mode.
• The same counter or timer number can-
not be programmed more than once.
• The preset input must be turned on ini-
tially so that the counted value returns to
the preset value.
• The preset input must be turned off
before counting may begin.
• When the up pulse and down pulse are on
simultaneously, no pulse is counted.
• The counter output is on only when the
counted value is zero.
• After the counted value reaches zero
(counting down), it changes to 9999 on
the next count down.
• After the counted value reaches 9999
(counting up), it changes to zero on the
next count up.
• When power is off, the counter’s counted
value is held.
• Counter preset values can be changed
without transferring the entire program to
the MICRO
3
base unit (see page 3-14).
• When the preset value is changed during
counter operation, the change becomes
effective immediately.
Counter Allocation Number Preset Value
Dual-pulse reversible counter CNT0
Constant: 0 to 9999
Data registers:
D0 to D99 (standard mode)
D0 to D31 (high-speed mode)
Up/down selection reversible counter CNT1
Adding (up) counter
CNT2 to CNT31 (standard mode)
CNT2 to CNT15 (high-speed mode)
500 500
I1
I0
Ladder Diagram (CNT0)
Key Operation
LOD
10
SET
I
OUT
16
RST
F
Q
Prgm Adrs Instruction Data
0
1
2
3
5
LOD
LOD
LOD
CNT
OUT
I0
I1
I2
0
500
Q0
Program List
LOD
10
C0
500
Q0
1
BPS
0
2
BRD
I2
Preset Input
Up Pulse
Down Pulse
LOD
10
SET
I
SET
I
CNT
C
0
LOD
10
5
CC=
0 0
0
Preset Input I0
ON
OFF
Up Pulse I1
ON
OFF
Down Pulse I2
ON
OFF
Timing Chart
Output Q0
ON
OFF
500 501 502 501
CNT0 Value
500 499 0 9999
• • •
• • •
Note: To enter a decimal con-
stant as a preset value, press the
LOD/10 key followed by the
preset value.