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

Page 485

Advertising
background image

L-force | PLC Designer

IEC Operators and additional norm extending functions



DMS 3.2 EN 02/2011 TD29

483

9.7.2

ADRINST

PLC Designer operator: Address Function not prescribed by the standard IEC61131-3.

ADRINST can be used within a function block instance to return the address of this
instance in a DWORD. This address can be sent to manufacturing functions to be
treated as a pointer or it can be assigned to a pointer within the project.

Examples in ST (within a function block instance):

dvar:=ADRINST(); (* Address of the instance is written to
variable dvar *)

fun(a:=ADRINST()); (* The instance address is given to input
parameter a of function fun *)

Examples in IL:

ADRINST

ST dvar

ADRINST

fun

9.7.3

BITADR

PLC Designer operator: Adress function, not prescribed by the standard IEC61131-3.

BITADR returns the bit offset within the segment in a DWORD. Regard that the offset
value depends on whether the option byte addressing in the target settings is
activated or not.

VAR
var1 AT %IX2.3:BOOL;
bitoffset: DWORD;

END_VAR

Example in ST:

bitoffset:=BITADR(var1); (* Result if byte addressing=TRUE:
19, if byte addressing=FALSE: 35 *)

Advertising