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 SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......