-

Semantic Error (SEM1065): Invalid implicit address '...'.

In a code worksheet, a bit position of an ANY_BIT variable shall be accessed which does not exist.

Error examples: In FBD/LD, the width of the WORD data type is exceeded (0..15). In the first ST example, the BYTE width (0..7) is exceeded. In the third ST line, a wrong suffix is used.

Background: Implicit Addressing of ANY_BIT

This feature is an IEC 61131 extension and allows access to specific parts of an already declared variable of an ANY_BIT data type by implicit addressing. Since ANY_BIT variables could be compared to "bit strings", it is possible to access (read or write) only one specific bit, byte or word of the variable (depending on the length of the accessed variable).

Implicit addressing is easily done by entering the variable name followed by a suffix specifying the part of the bit structure to be read or written. (In principle, this is similar to the access of structure elements.)

Syntax (by means of an LWORD example)

The following table shows which suffixes have to be used to access the specific parts of an LWORD variable. In the same way, the components of the other data types DWORD, WORD, BYTE or BOOL have to be addressed.

Note
The component to be accessed must be contained in a wider data type, e.g., DWORD in LWORD, BYTE in WORD, etc. Implicit addressing of the entire data type (MyWord.W0) is not possible.

Component to be accessed in an LWORD Access by variable name and suffixDescription
DWordMyVar.D0
MyVar.D1
'.D0' addresses the least significant word and '.D1' the most significant double word of the variable 'MyVar'.
WordMyVar.W0
...
MyVar.W3
'.W0' addresses the least significant word and '.W3' the most significant word of the variable 'MyVar'.
ByteMyVar.B0
...
MyVar.B7
'.B0' addresses the least significant byte and '.B7' the most significant byte of the variable 'MyVar'.
BitMyVar.X0
...
MyVar.X63
'.X0' addresses the least significant bit and '.X63' the most significant bit of the variable 'MyVar'.

Note
Implicit addressing is independent of the used controller type, i.e., it doesn't matter whether the byte order is Little Endian or Big Endian. In both cases, always the correct part of a variable is accessed.

Implicit addressing can be used in the graphical editor as well as in the text editor and is therefore available in all supported IEC 61131-3 programming languages.