BITADR

The operator is an extension of the IEC 61131-3 standard.

BITADR returns the bit offset within the segment in a DWORD.

The highest-value nibble (4 bits) in this DWORD describes the memory area:

Flags: 16x40000000

Input: 16x80000000

Output: 16xC0000000

CAUTION

Shift of contents of addresses through online change

If you use an online change, contents of addresses may shift.

Examples:

ST:

VAR
    bVar1 AT %IX2.3 : BOOL;
    nBitoffset : DWORD;
END_VAR

nBitoffset := BITADR(bVar1); (*Result if byte addressing=TRUE: 16x80000013, if byte addressing = FALSE : 16x80000023*)

FBD:

BITADR 1: