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

Page 505

Advertising
background image

L-force | PLC Designer

IEC Operators and additional norm extending functions



DMS 3.2 EN 02/2011 TD29

503

9.11

Initialization Operator

9.11.1

INI Operator

The INI operator can be used to initialize retain variables which are provided by a
function block instance used in the POU.

The operator must be assigned to a boolean variable.

Syntax: <bool-Variable> := INI(<FB-instance, TRUE|FALSE)

If the second parameter of the operator is set to TRUE, all retain variables defined in
the function block FB will be initialized.

Example in ST:

fbinst is the instance of function block fb, in which a retain variable retvar is defined.

Declaration in POU:

fbinst:fb;

b:bool;

Implementation part:

b := INI(fbinst, TRUE);

ivar:=fbinst.retvar (* => retvar gets initialized *)

Example of operator call in IL:

LD fbinst

INI TRUE

ST b

Example of operator call in FUP:

Advertising