Chapter 13 Structured Texts 13.1.4 Operand and Operator Operands and operators are basic elements of an expression. An operand is the object of an operation, and an operator is a symbol or function representing an operation. For example, in the expression D0 + D1, D0 and D1 are operands, and + is an operator. An expression can be composed of operands and operators. It can also be composed of a single operand. The operands in an expression can be devices, symbols, or constants. Rules of precedence affect which values form operands for which operators. If the operators in an expression share the same precedence, the order of the operation is carried out from left to right.
The operands which can be used in a structured text in ISPSoft are listed below. Symbol Function Data format Example of an Precedence expression Operand Result of an Expression Value operation (Value of an expression) ( ) The parenthetical part of an expression is calculated first.
Unspecified Unspecified (D0 + 6)* 3 33 Highest ** Exponentiation Floating-point number Floating-point number 2.0 ** 5.0 3.2E+1 - Negative sign Signed number Signed number -(D0 + 3) -8 NOT Logical negation Boolean value Boolean value NOT M0 TRUE * Multiplication Any value Any value D0 * 3 15 / Division Any value Any value 15 / D0 3 MOD Remainder Integer Integer D0 MOD 3 2 + , - Addition, subtraction Any value Any value D0 + 3 8 , = Comparison Any value Boolean value D0 > 2 TRUE 13-5