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;
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......