5-21
5 Designing Tasks
NJ-series CPU Unit Software User’s Manual (W501)
5-2 Task System
5
5-2-5 Event Task Execution Timing
Example 2: When Both Condition Expressions for Variables and the ActEventTask Instruction Are Used
In this example, the execution conditions of the T1, T2, and T3 event tasks are set as given below.
• T1: Condition expression for the VarA variable
• T2: Condition expression for the VarB variable
• T3: ActEventTask instruction
The operation would proceed as described below if the condition expression for VarA was met during
I/O refreshing, the ActEventTask instruction was executed in the user program, and the condition
expression for VarB was met during execution of the user program all in the same primary period.
(1) The condition expression for VarA is met during I/O refreshing.
(2) In system common processing 1, the match is detected for the condition expression
for VarA and T1 is executed. The condition expression for VarB is not yet met, so T2
is not executed.
(3) The condition expression for VarB is met during execution of the user program.
(4) The ActEventTask instruction is executed in the user program, so T3 is executed.
(5) In system common processing 1 in the next primary period, the match is detected for
the condition expression for VarB and T2 is executed.
High
Low
Execution
priority
T1 event task
(execution priority of 8)
T2 event task
(execution priority of 8)
T3 event task
(execution priority of 8)
Primary periodic
task
Primary period
Condition expression
for VarA is met.
ActEventTask
instruction is executed.
IO UPG MC
IO UPG MC
The match for the condition
expression for VarA is detected.
The match for the condition
expression for VarB is
detected.
Condition
expression for
VarB is met.