5-17
5 Designing Tasks
NJ-series CPU Unit Software User’s Manual (W501)
5-2 Task System
5
5-2-4 Event Task Execution Conditions
Example 2: Execution Condition for an Event Task Set to When Program1.curVal (INIT variable) 10
The event task is executed only once when the value of Program1.curVal changes from less
than 10 to 10 or higher.
The CPU Unit evaluates whether the condition expression is met before the programs that are
assigned to the primary periodic task are executed. Even if the specified value of the variable
matches the condition expression during execution of the program in the primary periodic task,
the condition is not evaluated until just before the next execution of the primary periodic task.
This means that the event task will be executed after the end of the execution of the primary peri-
odic task that follows the execution of the primary periodic task in which the value of the variable
meets the condition expression.
Event task
The event task is executed only once when
the value of the Program1.curVal variable
changes from less than 10 to 10 or higher.
High
Low
Execution
priority
Primary
periodic task
Primary period
Value of 9 is assigned to
Program1.curVal variable.
Condition expression
is not met.
Value of 10
is assigned.
Value of 11
is assigned.
Value of 9
is assigned.
Program1.curVal
9
9
10 110
MC
IO
UPG
MC
IO
UPG
MC
IO
UPG
MC
IO
UPG
MC
IO
UPG
Not met.
Not met.
Met