Parenthesis ( )
Operator - force the evaluation order in a complex expression.
Remarks
Parenthesis are used in ST and IL language for changing the default evaluation order of various operations within a complex expression. For instance, the default evaluation of "2 * 3 + 4" expression in ST language gives a result of 10 as "*" operator has highest priority. Changing the expression as "2 * ( 3 + 4 )" gives a result of 14. Parenthesis can be nested in a complex expression.
Below is the default evaluation order for ST language operations (first is highest priority):
Unary operators: - NOT
Multiply/Divide: * /
Add/Subtract: + -
Comparisons: < > <= >= = <>
Boolean And: & AND
Boolean Or: OR
Exclusive OR: XOR
ST Language
Q := (IN1 + (IN2 / IN 3)) * IN4;
FBD Language
Not available.
LD Language
Not available.
|
Parenthesis ( ) |
IEC 61131-3 Automation platform > Programming - Reference guide > Basic Operations > Parenthesis ( ) |
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's HTML5 template