Glossary
What is Boolean expression?
An expression whose result is TRUE or FALSE, built from comparisons and the operators AND, OR, XOR and NOT.
Precedence in ST is NOT first, then AND, then XOR, then OR. So A OR B AND C means A OR (B AND C). Brackets are clearer than relying on precedence.
In industrial control it is usually best to assign the expression straight to the output, so the output is fully computed every scan with no state left hanging.
Related terms
- IF statement
- The conditional in ST: IF ... THEN ... ELSIF ... ELSE ... END_IF. The most used statement in the language.
- Operator precedence
- The order an expression is evaluated in: brackets, then negation, then multiply and divide, then add and subtract, then comparisons, then AND, XOR and OR.