5 Designing Tasks
5-18
NJ-series CPU Unit Software User’s Manual (W501)
The execution priority of event tasks is 8 or 48. If the execution conditions for an event task are met
while another task is in execution, the task with the higher execution priority is given priority. The task
with the lower execution priority is interrupted. This is the same as with the primary periodic task and
periodic tasks. The execution of an event task also depends on its execution conditions. You can also
set the same execution priority for more than one event task. You must be careful when the execution
conditions are met for more than one event task that has the same execution priority.
The execution of event tasks depends on whether the execution condition is triggered by an ActEvent-
Task instruction or by when an condition expression for a variable is met.
Execution Timing When the Execution Condition Is an ActEventTask
Instruction
If the execution condition for an event task is triggered by an ActEventTask instruction, the event
task will be executed immediately after the ActEventTask instruction is executed.
Example 1: ActEventTask Instruction Executed in Priority-16 Periodic Task and an Event Task with
an Execution Priority of 8
The execution priority of the event task (execution priority of 8) is higher than the execution
priority of the priority-16 periodic task. Execution of the priority-16 periodic task is therefore
interrupted and the event task is executed.
Example 2: Executing an ActEventTask Instruction within the Primary Periodic Task
The event task has a lower execution priority than the primary periodic task, so the event task
is executed after execution of the primary periodic task is completed.
5-2-5 Event Task Execution Timing
Differences in Execution Timing Based on the Execution Conditions
of Event Tasks
Task period
High
Low
Execution
priority
Priority-16
periodic task
Event task
(execution priority of 8)
Interrupted.
ActEventTask instruction
is executed.
The event task is executed immediately after execution of ActEventTask.