Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions
IF
The IF construct uses the evaluation result of a specified condition expression to select one of two
statements to execute.
Instruction
IF
If
Variables
None
Function
The IF construct uses the evaluation result of a specified condition expression to select one of two
statements to execute. Use a condition expression that evaluates to TRUE or FALSE.
Item used for condition
expression
Logic expression
BOOL variable
BOOL constant
Function with a BOOL
return value
You can use the following operators in the logic expression.
Operator
=
Equals
<>
Not equals
<
<=
Comparison
>
>=
AND (&)
Logical AND
2-26
Name
FB/FUN
---
Example
a>3
If the value of variable a is greater than 3, the result is TRUE. Oth-
erwise, the result is FALSE.
a=b
If the values of variables a and b are equal, the result is TRUE. Oth-
erwise, the result is FALSE.
abc
If the value of variable abc is TRUE, the result is TRUE. If it is
FALSE, the result is FALSE.
TRUE
TRUE
FUN name
If the function returns TRUE, the result is TRUE. If it returns FALSE,
the result is FALSE.
Meaning
Example
a=b
a<>b
a<b
a<=b
a>b
a>=b
a AND b
a & b
Graphic expression
None
Evaluation result
Evaluation result
If the values of variables a and b are equal, the result is TRUE.
Otherwise, the result is FALSE.
If the values of variables a and b are not equal, the result is
TRUE. Otherwise, the result is FALSE.
If the value of variable a is less than the value of variable b, the
result is TRUE. Otherwise, the result is FALSE.
If the value of variable a is less than or equal to the value of
variable b, the result is TRUE. Otherwise, the result is FALSE.
If the value of variable a is greater than the value of variable b,
the result is TRUE. Otherwise, the result is FALSE.
If the value of variable a is greater than or equal to the value of
variable b, the result is TRUE. Otherwise, the result is FALSE.
The result is the logical AND of BOOL variables a and b.

NY-series Instructions Reference Manual (W560)

ST expression
IF condition expression
THEN
statement;
ELSIF condition expression
THEN
statement;
ELSE
statement;
END_IF;

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents