Omron SYSMAC CS/CJ Series Programming Manual page 185

Table of Contents

Advertisement

Using Tasks
Task Start Flag (A20014,
CS1-H, CJ1-H, or CJ1M
CPU Units only)
Flags Related to All Tasks
Task Error Flag (A29512)
Task Number when
Program Stopped (A294)
Examples of Tasks
164
The Task Start Flag can be used to perform initialization processing each time
the task cycle is started. The Task Start Flag turns OF whenever cycle task
status changes from Disabled (INI) or Standby (WAIT) status to READY status
(whereas the Initial Task Execution Flag turns ON only when status changes
from Disabled (INI) to READY).
Disabled
Task n
Task Start Flag
The Task Start Flag can be used to perform initialization processing whenever
a task goes from Standby to RUN status, i.e., when a task on Standby is
enabled using the TRON(820) instruction.
The Task Error Flag will turn ON if one of the following task errors occurs.
• No cyclic tasks (including extra cyclic tasks) are READY during a cycle.
• The program allocated to a cyclic task (including extra cyclic tasks) does
not exist. (This situation will not occur when using the CX-Programmer or
a Programming Console.)
• No program is allocated to an activated interrupt task.
The type of task and the current task number when a task stops execution
due to a program error will be stored as follows:
Type
Cyclic task
0000 to 001F Hex (correspond to task numbers 0 to 31)
Interrupt task 8000 to 80FF Hex (correspond to interrupt task numbers 0 to 255)
This information makes it easier to determine where the fatal error occurred,
and it will be cleared when the fatal error is cleared. The program address
where task operation stopped is stored in A298 (rightmost bits of the program
address) and in A299 (leftmost bits of the program address).
An overall control task that is set to go to READY status at the start of opera-
tion is generally used to control READY/Standby status for all other cyclic
tasks (including extra cyclic tasks). Of course, any cyclic task can control the
READY/Standby status of any other cyclic task as required by the application.
Ready
Ready
Disabled
Task Start Flag
A20014
Section 4-2
Initialization
processing
A294

Advertisement

Table of Contents
loading

Table of Contents