Structured Text Programming
528 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
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.
To do something when all of the IF or ELSIF conditions are false, add an ELSE
statement.
The table summarizes different combinations of IF, THEN, ELSIF, and ELSE.
If And Use this construct
Doing something if or when conditions are true Do nothing if conditions are false IF_THEN
Do something else if conditions are false IF_THEN_ELSE
Selecting alternative statements or groups of
statements based on input conditions
Do nothing if conditions are false IF_THEN_ELSIF
Assign default statements if all conditions are false IF_THEN_ELSIF_ELSE