EasyManua.ls Logo

Omron CP1E CPU UNIT SOFTWARE - Page 161

Omron CP1E CPU UNIT SOFTWARE
450 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
11-23
11 High-speed Counters
CP1E CPU Unit Software User’s Manual(W480)
11-3 High-speed Counter
Interrupts
11
11-3-3 High-speed Counter Interrupt Instruction
In this example, high-speed counter 0 operates in linear mode and starts interrupt task 10 when the
PV reaches 30,000 (0000 7530 hex) and starts interrupt task 11 when the PV reaches 20,000 (0000
4E20 hex).
1
Set high-speed counter 0 in the PLC Setup's Built-in Input Tab.
2
Set the target-value comparison table in words D1000 to D1006.
3
Create the programs for interrupt tasks 10 and 11.
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.
Example 1: Target Value Comparison
Item Setting
High-speed counter 0 Use counter
Counting mode Linear mode
Circular Max. Count
Reset method Software reset
Input Setting Up/Down inputs
Word Setting Function
D1000 #0002 Number of target values = 2
D1001 #7530 Rightmost 4 digits of the target value 1 data (30000) Target value =
30,000(0000 7530 hex)
D1002 #0000 Leftmost 4 digits of the target value 1 data (30000)
D1003 #000A Target value 1
Bit 15: 0 (incrementing)
Bits 00 to 07: A hex (interrupt task number 10)
D1004 #4E20 Rightmost 4 digits of the target value 2 data (20000) Target value =
20,000(0000 4E20 hex)
D1005 #0000 Leftmost 4 digits of the target value 2 data (20000)
D1006 #800B Target value 2
Bit 15: 1 (decrementing)
Bits 00 to 07: B hex (interrupt task number 11)
@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.

Table of Contents

Related product manuals