Omron NJ-series User Manual page 141

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

5 Designing Tasks
 Example of User Programming Using the ActEventTask Instruction
Example 1: Executing an Event Task Only Once When the Value of a Variable Changes
In the following example, the upward differentiation option is used for the ActEventTask instruction.
This causes the Task1 event task to be executed only once when the BoolVar BOOL variable
changes to TRUE.
BoolVar
'Task1'
Execution
priority
High
Primary
periodic task
Task1
event task
Low
BoolVar
Example 2: Executing an Event Task Repeatedly While the Value of a Variable Matches a Specified
Value
In the following example, the upward differentiation option is not used for the ActEventTask instruc-
tion. This causes the Task1 event task to be executed as long as the BoolVar BOOL variable is
TRUE. After the execution of the event task has started, it is executed to the end even if the value of
BoolVar changes to FALSE during execution.
BoolVar
'Task1'
Execution
priority
Primary period
High
Primary
periodic task
ActEventTask instruction
is executed.
Task1
event task
Task1 is already in execution so any ActEventTask
instructions that specify Task1 are ignored.
Low
TRUE
BoolVar
FALSE
5-14
@ActEventTask
EN
ENO
TaskName
Primary period
ActEventTask
instruction is executed.
TRUE
FALSE
ActEventTask
EN
ENO
TaskName
Interrupted.
The event task is executed repeatedly
while the BoolVar variable is TRUE.
The event task is executed only once.
Interrupted.
Interrupted.
After the execution of the event
task has started, it is executed
to the end even if the value of
the BoolVar variable changes
to FALSE.
NJ-series CPU Unit Software User's Manual (W501)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents