![background image](http://html1.mh-extra.com/html/omron/cj1g-cpu-series/cj1g-cpu-series_programming-manual_742489185.webp)
164
Using Tasks
Section 4-2
Task Start Flag (A20014,
CS1-H, CJ1-H, or CJ1M
CPU Units only)
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).
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.
Flags Related to All Tasks
Task Error Flag (A29512)
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.
Task Number when
Program Stopped (A294)
The type of task and the current task number when a task stops execution
due to a program error will be stored as follows:
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).
Examples of Tasks
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.
Task n
Ready
Disabled
Task Start Flag
Ready
Disabled
A20014
Initialization
processing
Task Start Flag
Type
A294
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)
Summary of Contents for CJ1G-CPU series
Page 3: ...iv...
Page 5: ...vi...
Page 21: ...xxii Conformance to EC Directives 6...
Page 169: ...148 Task Control Instructions Section 3 32...
Page 203: ...182 Programming Device Operations for Tasks Section 4 4...
Page 253: ...232 Using File Memory Section 5 3...
Page 337: ...316 Other Functions Section 6 11...
Page 347: ......
Page 369: ......
Page 373: ......
Page 379: ......
Page 381: ...360 Revision History...