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

L-force | PLC Designer
Programming Reference
1088
DMS 4.1 EN 03/2011 TD29
ADR
This address operator is not prescribed by the standard IEC 61131-3.
ADR returns the address of its argument 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.
Note: In contrast to »PLC Designer« V2.3 now the ADR-Operator can be used with
function names, program names, function block names and method names, thus
replacing the INDEXOF operator. See in this context 'Function pointers'. Notice
anyway that function pointers can be passed to external libraries, but there is no
possibility to call a function pointer within »PLC Designer«! In order to enable a
system call (runtime system) the respective property (category "Build") must be set
for the function object.
Example in ST:
dwVar:=ADR(bVAR);
Example in IL:
Note: After an Online Change there might be changes concerning the data on some
addresses. Notice this in this case of using pointers on addresses.
BITADR
This address operator is not prescribed by the standard IEC 61131-3.
BITADR returns the bit offset within the segment in a DWORD. Notice 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 *)