EasyManua.ls Logo

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION - Usage; Tion) Is Met

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
183 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
147
Structured Text (ST Language) Specifications Appendix B
IF A>0 AND B>1 THEN
X:=10; Y:=20;
ELSE
X:=0; Y:=0;
END_IF;
Example 3: If the boolean (BOOL data type) variable A=1(ON), variable X will be substituted with numerical
value 10. If variable A=0(OFF), variable X will be substituted with numerical value 0.
IF A THEN X:=10;
ELSE X:=0;
END_IF;
IF Statement (Multiple Conditions)
Summary
This statement is used to execute an expression when a specified condition is met. If the first condition is not
met, but another condition is met, a corresponding expression is executed. If none of the conditions is met, a
different expression is executed.
Reserved Words
IF, THEN, ELSIF, (ELSE)
Note ELSE can be omitted.
Statement Syntax
IF <condition_1> THEN <expression_1>;
ELSIF <condition_2> THEN <expression_2>;
ELSIF <condition_3> THEN <expression_3>;
...
ELSIF <condition_n> THEN <expression_n>;
ELSE <expression_m>;
END_IF;
Processing Flow Chart
Usage
Use the IF statement to perform different operations depending which of multiple conditions (condition equa-
tion) is met.
Condition 1
Condition 2
Condition 3
False
False
False
Tr ue
Tr ue
Tr ue
Expression 1
Expression 2
Expression 3
Expression m

Table of Contents

Related product manuals