Designing Tasks - Omron CJ2 - 02-2010 User Manual

Cj2 cpu unit software
Table of Contents

Advertisement

5 Understanding Programming
The interrupt overhead time after the CPU Unit receives the interrupt signal is the same as for I/O
interrupt tasks.
Extra Cyclic Tasks
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 starting at the lowest task number after execution of the
normal cyclic tasks (cyclic task numbers 0 to 127) has been completed. The maximum number of extra
cyclic tasks is 256 (Interrupt task numbers: 0 to 255).
Precautions for Correct Use
Precautions for Correct Use
Do not use task numbers assigned to extra cyclic tasks for interrupt tasks. An extra cyclic tasks
with the same task number as a power OFF interrupt task, a scheduled interrupt task, or an I/O
interrupt task will be executed both as an extra cyclic task and as an interrupt task.
Note 1 TKON(820) and TKOF(821) can be input and executed in an extra cyclic task, but they will not be executed
when the task is executed as an interrupt task.
2 The differences between normal cyclic tasks and extra cyclic tasks are listed in the following table.
Item
Activating at startup
Task Flags
Initial Task Execution Flag
(A200.15) and Task Start Flag
(A200.14)
Index (IR) and data (DR) register
values
5-2-4

Designing Tasks

Guidelines
Task design is important to build a system with a high degree of reliability and easy maintenance. Pay
attention to the following points.
• Divide programming into tasks based on the following.
• Consider specific conditions for execution and non-execution with an understanding of status tran-
sitions.
• Consider the presence or absence of external I/O.
• Consider functions and personnel in charge.
• Consider execution in order of priority. Separate processing into cyclic and interrupt tasks. Assign
the lowest number to the task with the highest priority.
5-28
Extra cyclic tasks
Setting is not possible.
Not supported.
Not supported.
Not defined when task is started
(same as normal interrupt tasks).
Values at the beginning of each
cycle are undefined. Always set val-
ues before using them. Values set
in the previous cycle cannot be
read.
Normal cyclic tasks
Set from CX-Programmer
Supported. (Cyclic task numbers 0
to 127 correspond to Task Flags
TK000 to TK127.)
Supported.
Undefined at the beginning of oper-
ation. Values set in the previous
cycle can be read.
CJ2 CPU Unit Software User's Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents