7 High-speed Counters
7-46
CJ2M CPU Unit Pulse I/O Module User’s Manual
z Ladder Program
The CTBL(882) instruction is used to execute interrupt tasks when the target positions are reached.
When the present value of the high-speed counter matches target value 1 (3,000), interrupt task 143
is executed.
2961.02
2961.03
Start motor
Reset when motor stops
Clear the PV of high-speed
counter 0 to 0.
Specifies high-speed counter 0
PV change
New PV data (Clears PV to 0.)
Confirm that the stop position is correct after the motor stops.
Motor stopped
Normal stop
position
Error stop
position
The stop position is normal if the
present value of the high-speed
counter (A270) is between 3500
(0DAC hex) and 3550 (0DDE hex).
An error stop will occur if the
present value of the
high-speed counter (A270) is
higher than 3550 (0DDE hex).
W0.02
2960.02
RSET
W0.02
MOVL
#0
D0
CTBL
#0
#0
D600
SET
2961.00
INI
#0010
#0002
D0
>=L
A270
&3500
>=L
A270
&3550
<L
A270
&3550
Specifies comparison with target
values and starts comparison
First word of comparison table
Motor operation reset.
Specifies high-speed counter 0
P_On
SET
2961.01
Interrupt task
number 143
Turns ON motor low
speed output.