Overview of Structured Text Programming
648 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018
Use IF_THEN to do something if or when specific conditions occur.
Operands
IF bool_expression THEN
<statement>;
Operand Type Format Enter
Bool_
expression
BOOL Tag expression BOOL tag or expression that evaluates to a BOOL value
(BOOL expression)
Description
The syntax is described in the table.
To use ELSIF or ELSE, follow these guidelines.
To select from several possible groups of statements, add one or more ELSIF
statements.
Each ELSIF represents an alternative path.
Specify as many ELSIF paths as you need.
The controller executes the first true IF or ELSIF and skips the rest of the ELSIFs
and the ELSE.