Omron CP1L - 12-2007 Operation Manual page 369

Cp1l cpu unit
Table of Contents

Advertisement

Interrupt Functions
Ladder Program
Examples
Example 1: High-speed
Counter (Linear Mode)
336
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).
1,2,3...
1. Set high-speed counter 0 in the PLC Setup's Built-in Input Tab.
Item
High-speed counter 0
Counting mode
Circular Max. Count
Reset method
Input Setting
2. Set the target-value comparison table in words D10000 to D10003.
Word
D10000
D10001
D10002
D10003
3. Create the program for interrupt task 10. Always put an END(001) instruc-
tion at the program's last address.
4. Use CTBL(882) to start the comparison operation with high-speed counter
0 and interrupt task 10.
W0.00
5. Operation
When execution condition W0.00 goes ON, the comparison starts with
high-speed counter 0.
When the PV of high speed counter 0 reaches 30,000, cyclic task process-
ing is interrupted, and interrupt task 10 is processed. When interrupt task
10 processing is completed, processing of the interrupted cyclic task re-
sumes.
Use counter
Linear mode
---
Software reset
Up/Down inputs
Setting
#0001
Number of target values = 1
#7530
Rightmost 4 digits of the target value 1 data Target value =
#0000
Leftmost 4 digits of the target value 1 data
#000A
Bit 15: 0 (incrementing)
Bits 0 to 7: A hex (interrupt task number 10)
@CTBL(882)
# 0000
# 0000
D100 00
Setting
Function
Use high-speed counter 0.
Register a target-value comparison table and
start comparison operation.
First comparison table word
Section 6-1
30,000
(0000 7530 hex)

Advertisement

Table of Contents
loading

Table of Contents