Overview of Structured Text Programming
Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018 651
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.