Task Control Instructions - Omron CJ2 CPU UNIT SOFTWARE User Manual

Cj2 cpu unit software
Hide thumbs Also See for CJ2 CPU UNIT SOFTWARE:
Table of Contents

Advertisement

Using Cyclic Tasks

Task Control Instructions

Use the Task Control Instructions to start or stop a cyclic task from a program. The instructions used
to start and stop tasks depend on the programming language as shown in the following list.
• Ladder programming and ST pro-
gramming:
• SFC programming:
• TASK ON and TASK OFF Instructions
TKON
TKOF
The TASK ON and TASK OFF instructions can be used to change any cyclic task between READY
and STANDBY status at any time. A cyclic task that is in READY status will maintain that status in
subsequent cycles, and a cyclic task that is in STANDBY status will maintain that status in subse-
quent cycles. The TASK ON and TASK OFF instructions can be used only in cyclic tasks. They can-
not be used in interrupt tasks.
Note At least one cyclic task must be in READY status in each cycle. If there is no cyclic task in
READY status, the Task Error Flag (A295.12) will turn ON, and the CPU Unit will stop.
Example: Cyclic Task
A
B
C
D
1) Task 0 will go to
READY status at the start
of operation.
Other tasks will remain in
DISABLED status.
CJ2 CPU Unit Software User's Manual
TKON(820) (TASK ON instruction) and TKOF(821) (TASK OFF
instruction)
SFCON(789) (SFC ON instruction) and SFCOFF(790) (SFC OFF
instruction)
A task will go to READY status
N = Task number
when the execution condition is
ON. The corresponding Task Flag
N
will turn ON.
A task will go to STANDBY status
N = Task number
when the execution condition is
N
ON. The corresponding Task Flag
will turn OFF.
Cyclic task 0
TKON 1
(Activated at the
start of operation)
Cyclic task 1
TKON 2
TKON 3
Cyclic task 2
TKOF
Cyclic task 3
2) Task 1 will go to
Cyclic task 0
READY status if A
is ON, and tasks 2
and 3 will remain In
Cyclic task 1
DISABLED status.
Cyclic task 2
Cyclic task 3
5 Understanding Programming
Cyclic task 0
3) Task 0 will go to
STANDBY status if D
is ON.
Cyclic task 1
Other tasks will
remain in their
current status.
Cyclic task 2
Cyclic task 3
: READY status
: STANDBY/DISABLED status
Cyclic task 0
Cyclic task 1
Cyclic task 2
Cyclic task 3
5-17
5

Advertisement

Table of Contents
loading

Table of Contents