Overview of Structured Text Programming
644 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018
The operations you write into an expression are performed in a prescribed order,
not necessarily from left to right.
• Operations of equal order are performed from left to right.
• If an expression contains multiple operators or functions, group the
conditions in parenthesis "( )". This ensures the correct order of execution
and makes it easier to read the expression.
Order Operation
1 ()
2 function (...)
3 **
4 - (negate)
5 NOT
6 *,/,MOD
7 +,- (subtract)
8 <,<=,>,>=
9 =,<>
10 &,AND
11 XOR
12 OR
See also
Structured Text Components: Expressions on page 638
Structured text statements can also be instructions. A structured text instruction
executes each time it is scanned. A structured text instruction within a construct
executes every time the conditions of the construct are true. If the conditions of
the construct are false, the statements within the construct are not scanned. There
is no rung-condition or state transition that triggers execution.
This differs from function block instructions that use EnableIn to trigger
execution. Structured text instructions execute as if EnableIn is always set.
This also differs from relay ladder instructions that use rung-condition-in to
trigger execution. Some relay ladder instructions only execute when rung-
condition-in toggles from false to true. These are transitional relay ladder
instructions. In structured text, instructions will execute each time they are
scanned unless you pre-condition the execution of the structured text instruction.
For example, the ABL instruction is a transitional instruction in relay ladder. In
this example, the ABL instruction only executes on a scan when tag_xic transitions
execution
Components: Instructions