Parenthesis ( )
Remarks
- Parentheses are used in ST and IL languages for changing the default evaluation order of various operations within a complex expression.
- Example: The default evaluation of 2 * 3 + 4 expression in ST Language gives a result of 10 because * operator has the highest priority.
- Changing the expression as 2 * ( 3 + 4) gives a result of 14.
- Parentheses can be nested in a complex expression.
These are the default evaluation priority order for ST language operations:
|
Priority |
Operation |
Description |
|---|---|---|
|
1 |
- NOT |
Unary operators |
|
2 |
* / |
Multiply / Divide |
|
3 |
+ - |
Add / Subtract |
|
4 |
< > <= >= = <> |
Comparisons |
|
5 |
& AND |
Boolean And |
|
6 |
OR |
Boolean Or |
|
7 |
XOR |
Exclusive OR |
FBD Language Example
Not available.
FFLD Language Example
Not available.
IL Language Example
Not available.
ST Language Example
Q := (IN1 + (IN2 / IN 3)) * IN4;
See Also




