Appendix (e.g., "A_BCD" and "AB_CD" are considered two different identifiers). An identifier may not have more than one underscore character in a row. The first 32 characters are significant. Variables can be used anywhere the declared type allows for them. You can access available variables through the Input Assistant. 10.6.2.1 Addresses The direct display of individual memory locations is done through the use of special character sequences. These sequences are a concatenation of the percent sign "%", a range prefix, a prefix for the size and one or more natural numbers separated by blank spaces. The following range prefixes are supported: 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. NOTE 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; 10.6.2.2 Accessing variables for arrays, structures and POUs Two-dimensional array components can be accessed using the following syntax: [Index1, Index2] TwinCAT 2 PLC Control 332 Version: 1.0 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) _