Parenthesis ( )
Remarks
- Parentheses are used in ST
"Structured text"
A high-level language that is block structured and syntactically resembles Pascal and IL
"Instruction list"
This is a low-level language and resembles assembly 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 |
- In the IL language:
- The default order is the sequence of instructions.
- Each new instruction modifies the current result sequentially.
- The opening parenthesis "(" is written between the instruction and its operand.
- The closing parenthesis ")" must be written alone as an instruction without operand.
- The default order is the sequence of instructions.
FBD Language
Not available.
FFLD Language
Not available.
IL Language
Op1: FFLD( IN1
ADD( IN2
MUL IN3
)
SUB IN4
)
ST Q (* Q is: (IN1 + (IN2 * IN3) - IN4) *)
ST Language
Q := (IN1 + (IN2 / IN 3)) * IN4;
See Also





