EasyManua.ls Logo

Omron CX-PROGRAMMER V8.1 - Page 177

Omron CX-PROGRAMMER V8.1
231 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...
152
Statement Descriptions Section 5-5
Multiple statements can be executed in expression_@. Be sure to use a
semicolon (;) delimiter between multiple statements in an expression.
The ELSE statement can be omitted. When ELSE is omitted, no opera-
tion is executed if the result of any condition equation is false.
Examples
Example 1: If variable A>0 is true, variable X will be substituted with numerical
value 10.
If A>0 is false, but variable B=1, variable X will be substituted with numerical
value 1.
If A>0 is false, but variable B=2, variable X will be substituted with numerical
value 2.
If either of these conditions is met, variable X will be substituted with numeri-
cal value 0.
IF A>0 THEN X:=10;
ELSIF B=1 THEN X:=1;
ELSIF B=2 THEN X:=2;
ELSE X:=0;
END_IF;
CASE Statement
Summary
This statement executes an expression containing a selected integer that
matches the value from an integer equation. If the selected integer value is
not the same, either no expression or a specified expression is executed.
Reserved Word
CASE
Statement Syntax
CASE <integer_equation> OF
<integer_equation_value_1 >:<expression_1>;
<integer_equation_value_2>:<expression_2>;
...
<integer_equation_value_n>:<expression_n>;
ELSE <expression_m>;
END_CASE;

Table of Contents

Related product manuals