7 High-speed Counters
2
Set the target-value comparison table in words D1000 to D1006.
Word
D1000
D1001
D1002
D1003
D1004
D1005
D1006
3
Create the programs for interrupt tasks 10 and 11.
4
Use the CTBL(882) instruction to start the comparison operation with high-speed counter 0 and
interrupt tasks 10 and 11.
W0.00
When execution condition W0.00 turns ON, the comparison starts for high-speed counter 0.
When the PV of high speed counter 0 is incremented to 30,000, cyclic task execution is
interrupted, and interrupt task 10 is executed.
When the PV of high speed counter 0 is decremented to 20,000, cyclic task execution is
interrupted, and interrupt task 11 is executed.
When interrupt task 10 or 11 execution has been completed, execution of the interrupted
cyclic task resumes.
Target value = 30,000 (7530 hex)
A270 and A271
(High-speed
Counter 0 PV)
Target value = 20,000 (4E20 hex)
7-32
Setting
#0002
Number of target values = 2
#7530
Rightmost 4 digits of the target value 1 data (30,000)
#0000
Leftmost 4 digits of the target value 1 data (30,000)
#000A
Target value 1
Bit 15: 0 (incrementing)
Bits 00 to 07: A hex (interrupt task number 10)
#4E20
Rightmost 4 digits of the target value 2 data (20,000)
#0000
Leftmost 4 digits of the target value 2 data (20,000)
#800B
Target value 2
Bit 15: 1 (decrementing)
Bits 00 to 07: B hex (interrupt task number 11)
@CTBL
#0000
#0000
D1000
W0.00
CIO 2960.08
CIO 2960.09
0
Counting enabled
Cyclic task
processing
Description
Uses high-speed counter 0.
Registers a target value comparison
table and starts comparison.
First comparison table word
Interrupted
Cyclic task
Interrupted
processing
Interrupt task
Interrupt task
10 processing
11 processing
CJ2M CPU Unit Pulse I/O Module User's Manual
Target value = 30,000
Target value = 20,000
Cyclic task
processing