Reference programming The following size prefixes are supported: Examples: %QX75.1 (*Bit 1 of output byte 75*) %IW215 (*Input word 215*) %QB7 (*Output byte 7*) %MD48 (*Double word in memory position 48 in the memory location*) Boolean values will be allocated bytewise, if no explicit single-bit address is specified Example: A change in the value of varbool1 AT %QW0 affects the range from QX0.0 to QX0.7. Memory location You can use any supported size to access the memory location, however the addressing is always bytewise. For example, the address %MD48 would address bytes numbers 48, 49, 50, and 51 in the memory location area because the size of a DWORD is 4 bytes.
You can access words, bytes, and bits in the same way: the address %MX5.0 allows you to access the first bit in the fifth byte. NOTICE Using other platforms For a CX9xxx and CP with ARM platform, the 4-byte alignment is obligatory to be complained. Example: rMyVar1 AT %MW0 : REAL; rMyVar2 AT %MW4 : REAL; 7.3.2.2 Accessing variables for arrays, structures and POUs Two-dimensional array components can be accessed using the following syntax: [Index1, Index2] Structure variables can be accessed using the following syntax: . Function block and program variables can be accessed using the following syntax: . 7.3.2.3 Addressing bits in variables In integer variables, individual bits can be accessed.
For this, the index of the bit to be addressed is appended to the variable, separated by a dot. The bit-index can be given by any constant. Indexing is 0- based. Example: TX1200 216 Version: 1.3 Prefix Description I Input Q Output M Memory location Prefix Description X Single bit B Byte (8 Bit) W Word (16 Bit) D Double word (32 Bit) * Config variables (VAR CONFIG) _