L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 344

Advertising
background image

L-force | PLC Designer

Editors in PLC Designer

342

DMS 3.2 EN 02/2011 TD29



Feedback paths in CFC

Feedback paths can only be displayed directly in the continuous function chart editor
and not in the usual function block diagram editor. Here it should be observed that
the output of a block always carries an internal intermediate variable. The data type of
the intermediate variable results, for operators, from the largest data type of the
inputs.

The data type of a constant is obtained from the smallest possible data type, that is
the constant '1' adopts the data type SINT. If now an addition with feedback and the
constant '1' is executed, the first input gives the data type SINT and the second is
undefined because of the feedback. Thus the intermediate variable is also of the type
SINT. The value of the intermediate variable is only then allocated to the output

variable.

The diagram below shows an addition with feedback and an addition with a variable.

The variables x and y should be of the type INT here.

There are differences between the two additions:

The variable y can be initialised with a value which is not equal to zero but this is not
the case for intermediate variable for the left addition.

The intermediate variable for the left addition has the data type SINT while that on
the right has the data type INT. The variables x and y have different values after the
129

th

call up. The variable x, although it is of the type INT, contains the value 127

because the intermediate variable has gone into overflow. The variable y contains the
value 129, on the other hand.

Advertising