5 Designing Tasks
5-16
NJ-series CPU Unit Software User’s Manual (W501)
Condition Expressions That You Can Specify
The condition expressions that you can specify depend on the data type of the variable that you
specify for the condition expression. If the variable that you specify for a condition expression is bit
string data, integer data, or real data, you must set a comparison constant to compare to the value
of the variable.
Valid Range of Comparison Constants
If the variable that you specify for a condition expression is bit string data, integer data, or real data,
you must set a comparison constant to compare to the value of the variable. The valid range of com-
parison constants is the same as the valid range of the data type of the variable that you specify for
the condition expression.
Refer to Basic Data Types and Derivative Data Types on page 6-31 for the valid range of values for
each data type. For example, if the variable that you specify for the condition expression is a BYTE
variable, the valid range of comparison constant values is from BYTE#16#00 to BYTE#16#FF.
Example of Executing Event Tasks When Condition Expressions for Variables
Are Met
Example 1: Execution Condition for Event Task Set to a Change to TRUE of the Program1.trigger1
Boolean Variable
When the value of Program1.trigger1 changes to TRUE, the event task is executed only once.
Data type Possible condition expressions
Boolean, Boolean array elements, Boolean structure members,
and Boolean union members
Change to TRUE
Change to FALSE
Bit string, real number, integer, as well as array element, struc-
ture member, or union member with one of those data types
Variable = {Comparison constant}
Variable {Comparison constant}
Variable > {Comparison constant}
Variable {Comparison constant}
Variable < {Comparison constant}
Variable {Comparison constant}
Program1.trigger1
Event task
The event task is executed only once.
TRUE
FALSE
High
Low
Execution
priority
Primary
periodic task
Primary period
TRUE is assigned to
Program1.trigger1 variable.
Condition expression
is met.
Condition expression
is not met.
MC
IO
UPG
MC
IO
UPG
MC
IO
UPG
MC
IO
UPG
MC
IO
UPG