Expressions, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 759

Advertising
background image

L-force | PLC Designer

General Editors

DMS 4.1 EN 03/2011 TD29

757

Expressions
An expression is a construction which after its evaluation returns a value This value is
used in instructions.
Expressions are composed of operators, operands and/or assignments. An operand
can be a constant, a variable, a function call or another expression.
Examples:

33

(* constant *)

ivar

(* variable *)

fct(a,b,c)

(* function call *)

a AND b

(* expression *)

(x*y) / z

(* expression *)

real_var2 := int_var;

(* assignment, see below *)


Valuation of expressions
The evaluation of expression takes place by means of processing the operators
according to certain binding rules. The operator with the strongest binding is
processed first, then the operator with the next strongest binding, etc., until all
operators have been processed.
Operators with equal binding strength are processed from left to right.
Below you find a table of the ST operators in the order of their binding strength:

Operation

Symbol

Binding strength

Put in parentheses

(expression)

Strongest binding

Function call

Function name
(parameter list)

Exponentiation

EXPT

Negate
Building of complements

-
NOT

Multiply
Divide
Modulo

*
/
MOD

Add
Subtract

+
-

Compare

<,>,<=,>=

Equal to
Not equal to

=
<>

Boolean AND

AND

Boolean XOR

XOR

Boolean OR

OR

Weakest binding

Advertising