11-23
11 High-speed Counters
CP2E CPU Unit Software User’s Manual(W614)
11-3 High-speed Counter
Interrupts
11
11-3-3 High-speed Counter Interrupt Instruction
4
Use the CTBL instruction to start the comparison operation with high-speed counter 0 and inter-
rupt tasks 10 and 11.
When execution condition W0.00 turns ON, the comparison starts with high-speed counter 0.
When the PV of high speed counter 0 reaches 30,000, cyclic task execution is interrupted, and
interrupt task 10 is executed.
When the PV of high speed counter 0 reaches 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.
In this example, high-speed counter 1 operates in circular (ring) mode and starts interrupt task 12
when the PV is between 25,000 (0000 61A8 hex) and 25,500 (0000 639C hex).
The maximum ring count is set to 50,000 (0000 C350 hex).
1
Set high-speed counter 1 on the PLC Setup’s Built-in Input Tab Page.
Example 2: Range Comparison
Item Setting
High-speed counter 1 Use counter
Counting mode Circular mode
Circular Max. Count 50,000
Reset method Software reset (continue comparing)
Input Setting Up/Down inputs
@CTBL
#0000
#0000
D1000
W0.00
Use high-speed counter 0.
Register a target-value comparison
table and start comparison operation.
First comparison table word.
W0.00
0
0.00
0.01
High-speed counter 0 PV
(in A270 and A271)
Counting enabled
Cyclic task
execution
Cyclic task
execution
Cyclic task
execution
Processing
interrupted
Processing
interrupted
Interrupt task
10 execution
Interrupt task
11 execution
Lower limit:
20,000 (4E20 Hex)
Upper limit:
30,000 (7530 Hex)