Structured Text Programming
Rockwell Automation Publication 1756-RM006K-EN-P - November 2018 523
Use CASE_OF to select what to do based on a numerical value.
Operands
CASE numeric_expression OF
selector1: statement;
selectorN: statement; ELSE
Structured Text
Operand Type Format Enter
Numeric_
expression
SINT INT DINT REAL Tag expression Tag or expression that evaluates to a
number
(numeric expression)
Selector SINT INT DINT REAL Immediate Same type as numeric_expression
Important:
If using REAL values, use a range of values for a selector because a REAL
value is more likely to be within a range of values than an exact match of
one, specific value.
Description
The syntax is described in the table.
These are the syntax for entering the selector values.
When selector is Enter
One value value: statement