Omron CP1E CPU UNIT SOFTWARE User Manual page 161

Cp1e cpu unit software
Table of Contents

Advertisement

Example 1: Target Value Comparison
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.
High-speed counter 0
Counting mode
Circular Max. Count
Reset method
Input Setting
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 instruction to start the comparison operation with high-speed counter 0 and inter-
rupt tasks 10 and 11.
W0.00
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.
CP1E CPU Unit Software User's Manual(W480)
Item
Setting
Use counter
Linear mode
Software reset
Up/Down inputs
Setting
#0002
Number of target values = 2
#7530
Rightmost 4 digits of the target value 1 data (30000)
#0000
Leftmost 4 digits of the target value 1 data (30000)
#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 (20000)
#0000
Leftmost 4 digits of the target value 2 data (20000)
#800B
Target value 2
Bit 15: 1 (decrementing)
Bits 00 to 07: B hex (interrupt task number 11)
@CTBL
#0000
#0000
D1000
Function
Use high-speed counter 0.
Register a target-value comparison
table and start comparison operation.
First comparison table word.
11 High-speed Counters
Target value =
30,000(0000 7530 hex)
Target value =
20,000(0000 4E20 hex)
11
11-23

Advertisement

Table of Contents
loading

Table of Contents