Specifications

5.1 ST
5.1.2 Operators in ST language
5-3
5
WRITING
PROGRAMS
5.1.2 Operators in ST language
The following table shows the operators used in the ST program and their priorities.
Table 5.1.2-1 Operators in the ST language
If a syntax includes multiple operators with a same priority, the operation is performed from the
leftmost operator.
The following table shows the operators, applicable data types, and operation result data types.
Table 5.1.2-2 Data types used in operators
Operator Description Example Priority
( ) Parenthesized expression (1+2)*(3+4)
Highest
Lowest
Function ( ) Function (Parameter list) ADD_E(bo01, in01, in02, in03)
** Exponentiation re01:= 2.0 ** 4.4
NOT Logical negation NOT bo01
*
/
MOD
Multiplication
Division
Modulus operation
3 * 4
12 / 3
13 MOD 3
+
-
Addition
Subtraction
in01 + in02
in01 - in02
<, >, <=, => Comparison in01 < in02
=
<>
Equality
Inequality
in01 = in02
in01 <> in02
AND, & Logical AND bo01 & bo02
XOR Exclusive OR bo01 XOR bo02
OR Logical OR bo01 OR bo02
Operator Applicable data type Operation result data type
*, /, +, - ANY_NUM ANY_NUM
<, >, <=, >=, =, <> ANY_SIMPLE Bit
MOD ANY_INT ANY_INT
AND, &, XOR, OR, NOT ANY_BIT ANY_BIT
**
ANY_REAL (Base)
ANY_NUM (Exponent)
ANY_REAL