Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 88

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Programming with Tasks
Input Interrupts (Direct
Mode and Counter Mode)
Scheduled Interrupt Tasks
High-speed Counter
Interrupts
External Interrupt Tasks
(CP1H CPU Units)
Extra Cyclic Tasks
Note
An interrupt task can be executed each time one of the built-in inputs on the
CPU Unit turns ON or OFF (Direct Mode) or when a specified number of
inputs has been counted (Count Mode).
CPU Unit model
CP1H
X or XA
Y
CP1L
M (30 or 40 I/O points)
L (20 I/O points)
L (14 I/O points)
A scheduled interrupt task will be executed at a fixed interval based on the
internal timer of the CPU Unit. Only one scheduled interrupt tasks can be
used (interrupt task number:2).
Pulse inputs to a built-in high-speed counter in the CPU Unit can be counted
to trigger execution of an interrupt.
A user-specified interrupt task (interrupt task numbers 0 to 255) can be exe-
cuted when an external interrupt occurs.
The interrupt task will be executed when requested by a user program running
in a CJ-series Special I/O Unit or CJ-series CPU Bus Unit.
Up to 256 external interrupt tasks can be used (interrupt task numbers: 0 to
255). If an external interrupt task has the same number as scheduled, input,
or high-speed counter interrupt task, the interrupt task will be executed for
either condition (the two conditions will operate with OR logic) but basically
task numbers should not be duplicated.
An interrupt tasks can be executed every cycle, just like the normal cyclic
tasks. Extra cyclic tasks (interrupt task numbers 0 to 255) are executed start-
ing at the lowest task number after execution of the normal cyclic task (cyclic
task numbers 0 to 31) has been completed. The maximum number of extra
cyclic tasks is 256 (Interrupt task numbers: 0 to 255). Cycle interrupt tasks,
however, are different from normal cyclic tasks in that they are started with
TKON(820), i.e., they cannot be started automatically at startup.
If an extra cyclic task has the same number as a scheduled, input, or high-
speed counter interrupt task, the interrupt task will be executed for either con-
dition (the two conditions will operate with OR logic). Do not use interrupt
tasks both as normal interrupt tasks and as extra cyclic tasks.
(1) Also, TKON(820) and TKOF(821) cannot be used in extra cyclic tasks,
meaning that normal cyclic tasks and other extra cyclic tasks cannot be
controlled from within an extra cyclic task.
(2) The differences between normal cyclic tasks and extra cyclic tasks are
listed in the following table.
Item
Activating at startup
Using TKON(820)
and TKOF(821)
inside task
Task Flags
Number of tasks
8 tasks max.
6 tasks max.
6 tasks max.
6 tasks max.
4 tasks max.
Extra cyclic tasks
Not supported.
Not supported.
Not supported.
Section 2-1
Interrupt task numbers
140 to 147
140 to 145
140 to 145
140 to 145
140 to 143
Normal cyclic tasks
Supported. (Set from CX-
Programmer.)
Supported.
Supported. (Cyclic task
numbers 00 to 31 corre-
spond to Task Flags TK00 to
TK31.)
55

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents