ST Expressions
An expression is a construct that returns a value following its evaluation.
Expressions consist of operators and operands. In Extended Structured Text (ExST), you can also use assignments as expressions.
An operand can be a constant, variable, function call, or another expression.
Special ST expressions are also:
Access to
Elements of array variables
Components of a structure variable
Variables of a function block instance or a program
| Constant, literal |
| Variable |
| Function call |
| Expression |
| In ExST: Assignment |
Evaluation of expressions
An expression is evaluated by processing the operators according to specific binding rules. CODESYS first processes the operator with the strongest binding. Operators with the same binding strength are processed from left to right.
Operation | Symbol | Binding strength |
---|---|---|
Bracketing |
| Strongest binding |
Function call |
All operators with syntax: | |
Exponentiate |
| |
Negate Complementation |
| |
Multiplication Division Modulo |
| |
Addition Subtraction |
| |
Compare |
| |
Equality Inequality |
| |
Boolean AND |
| |
Boolean XOR Boolean OR |
| Weakest binding |