2 Instruction Descriptions
2-28
NJ-series Instructions Reference Manual (W502)
CASE
You use the CASE construct to select the statement to execute based on the value of a specified inte-
ger expression.
None
You use the CASE construct to select the statement to execute based on the value of a specified inte-
ger expression.
You can use any of the following as the integer expression and values.
The flowchart in the following example shows the processing flow for an integer expression. You can
use more than one statement for each of the statements.
CASE integer expression OF
1 :
statement 1;
2 :
statement 2;
.
.
.
n :
statement n;
ELSE
statement m;
END_CASE;
Instruction Name FB/FUN Graphic expression ST expression
CASE Case --- None CASE integer expression
OF
value:
statement;
value:
statement;
·
·
·
ELSE
statement;
END_CASE;
Variables
Function
Allowed notation
Integer expression Integer variable, integer constant, integer expression, or a
function that returns an integer return value, enumeration
variable, enumeration expression, or enumerator
Values Integer constants