Structured Text Expressions and Operators

An expression consists of operands and operators. An operand can be a constant, a variable, function or function block. Operators are defined by the IEC standard. They are listed below. Here are some examples.

Operators

No. Operation Symbol Precedence
1 Parenthesis (expression)

Highest

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Lowest

2 Function/Function block

F/FB name (Argument list)

Examples: LN(A), MAX(X,Y)

3 Exponentiation **
4 Negation -
5 Complement NOT
6 Multiply *
7 Divide /
8 Modulo MOD
9 Add +
10 Subtract -
11 Comparison <,>,<=,>=
12 Equality =
13 Inequality <>
14 Boolean AND &
15 Boolean AND AND
16 Boolean Exclusive OR XOR
17 Boolean OR OR

Operator Details

 

 

 

 

 

 

 

 

 

 

LM113-2