Variables can be represented symbolically, i.e. accessed through their identifier, or alternatively in a manner which directly represents the association of the data element with physical or logical locations in the programmable controller’s input, output, or memory structure.Direct representation of a single-element variable is provided by a special symbol formed by the concatenation of the percent sign “%”, a location prefix and a size prefix, and one or two unsigned integers, separated by periods (.).%location.size.index.index
location:
The location prefix may be one of the following:
Location prefix
Description
I
Input location
Q
Output location
M
Memory location
size:
The size prefix may be one of the following:
Size prefix
Description
X
Single bit size
B
Byte (8 bits) size
W
Word (16 bits) size
D
Double word (32 bits) size
L
Long word (64 bits) size
R
Real (32 bits) size
Q
Long real (64 bits) size
index.index:
This sequence of unsigned integers, separated by dots, specifies the actual position of the variable in the area specified by the location prefix.Example
Direct representation
Description
%MW4.6
Word starting from the first byte of the 7th element of memory data block 4.
%IX0.4
First bit of the first byte of the 5th element of input set 0.
Note that the absolute position depends on the size of the data block elements, not on the size prefix. As a matter of fact, %MW4.6 and %MD4.6 begin from the same byte in memory, but the former points to an area which is 16 bits shorter than the latter.For advanced users only: if the index consists of one integer only (no dots), then it loses any reference to data blocks, and it points directly to the byte in memory having the index value as its absolute address.
Direct representation
Description
%MW4.6
Word starting from the first byte of the 7th element of data block 4 in memory.
Variable XQuote is 32 bits long, and it is automatically allocated by the GF_ProjectVX codecompiler.
Variable Enabling is initialized to FALSE after target reset.
Variable TorqueCurrent is allocated in the memory area of the target device, and it takes 16 bits starting from the first byte of the 33rd element of datablock 4.
Variable Counters is an array of 10 independent variables of type unsigned integer.