Direct Variable User Programming Memory
Video Tutorial
User Direct Variable Memory variables are defined as follows:
There are 2 main memory locations for User assignment: M and W. Each memory area is defined through direct variables by data type. The only difference in the Memory area is the retain setting.
For Modbus TCP communications, a direct memory address variable is required for data transfer.
If using variables in the same memory area with a different data type designator, ensure that each variable is referencing a unique memory address, or data could be written over (See example below).
Configurable Retain
These registers can be configured for RETAIN setting in the Basic Parameter area of the project window.
Memory Area | Data Type Designator | Direct Variable Tag by Data Type |
---|---|---|
M |
X (bit) |
%MX0 -%MX262143 |
B (byte) |
%MB0 -%MB32767 | |
W (Word) |
%MW0 -%MW16383 | |
D (Double Word) |
%MD0 -%MD8191 | |
L (Long Word) |
%ML0 -%ML4095 |
Always Retain
These registers will always retain their value.
Note: In the LS Documentation, there is reference to W and R memory locations. These are the same physical memory location. ADC recommends using the W memory address. Do not use R.
Memory Area | Data Type Designator | Direct Variable Tag by Data Type |
---|---|---|
W |
X (bit) |
%WX0 - %WX542287 |
B (byte) |
%WB0 - %WB65535 | |
W (Word) |
%WW0 - %WW32767 | |
D (Double Word) |
%WD0 - %WD16383 | |
L (Long Word) |
%WL0 - %WL8191 |
Memory can be defined by different direct variable name based on the Data Type designator (X, B, W, D, L).
A physical memory location will have a different direct variable name depending on the Data type designator.
%MX1601 can also be defined as:
-
%MB200.1
-
%MW100.1
-
%MD50.1
-
%ML25.1
Physical Memory M | Direct Variable Address for a Physical Memory Block | ||||
---|---|---|---|---|---|
X (bit) 1 bit |
B (byte) 8 bits |
W (word) 16 bits |
D (dbl word) 32 bits |
L (long word) 64 bits |
|
Bit1600 | %MX1600 | ||||
Bit1601 | %MX1601 | %MB200.1 | %MW100.1 | %MD50.1 | %ML25.1 |
Bit1602 | %MX1602 | %MB200 | %MW100 | %MD50 | |
Bit1603 | %MX1603 | ||||
Bit1604 | %MX1604 | ||||
Bit1605 | %MX1605 | ||||
Bit1606 | %MX1606 | ||||
Bit1607 | %MX1607 | ||||
Bit1608 | %MX1608 | %MB201 | |||
Bit1609 | %MX1609 | ||||
Bit1610 | %MX1610 | ||||
Bit1611 | %MX1611 | ||||
Bit1612 | %MX1612 | ||||
Bit1613 | %MX1613 | ||||
Bit1614 | %MX1614 | ||||
Bit1615 | %MX1615 | ||||
Bit1616 | %MX1616 | %MB202 | %MW101 | ||
Bit1617 | %MX1617 | ||||
Bit1618 | %MX1618 | ||||
Bit1619 | %MX1619 | ||||
Bit1620 | %MX1620 | ||||
Bit1621 | %MX1621 | ||||
Bit1622 | %MX1622 | ||||
Bit1623 | %MX1623 | ||||
Bit1624 | %MX1624 | %MB203 | |||
Bit1625 | %MX1625 | ||||
Bit1626 | %MX1626 | ||||
Bit1627 | %MX1627 | ||||
Bit1628 | %MX1628 | ||||
Bit1629 | %MX1629 | ||||
Bit1630 | %MX1630 | ||||
Bit1631 | %MX1631 |
Physical Memory M | Direct Variable Address for a Physical Memory Block | ||||
---|---|---|---|---|---|
X (bit) 1 bit |
B (byte) 8 bits |
W (word) 16 bits |
D (dbl word) 32 bits |
L (long word) 64 bits |
|
Bit0 | %MX0 | %MB0 | %MW0 | %MD0 | %ML0 |
Bit1 | %MX1 | ||||
Bit2 | %MX2 | ||||
Bit3 | %MX3 | ||||
Bit4 | %MX4 | ||||
Bit5 | %MX5 | ||||
Bit6 | %MX6 | ||||
Bit7 | %MX7 | ||||
Bit8 | %MX8 | %MB1 | |||
Bit9 | %MX9 | ||||
Bit10 | %MX10 | ||||
Bit11 | %MX11 | ||||
Bit12 | %MX12 | ||||
Bit13 | %MX13 | ||||
Bit14 | %MX14 | ||||
Bit15 | %MX15 | ||||
Bit16 | %MX16 | %MB3 | %MW1 | ||
Bit17 | %MX17 | ||||
Bit18 | %MX18 | ||||
Bit19 | %MX19 | ||||
Bit20 | %MX20 | ||||
Bit21 | %MX21 | ||||
Bit22 | %MX22 | ||||
Bit23 | %MX23 | ||||
Bit24 | %MX24 | %MB4 | |||
Bit25 | %MX25 | ||||
Bit26 | %MX26 | ||||
Bit27 | %MX27 | ||||
Bit28 | %MX28 | ||||
Bit29 | %MX29 | ||||
Bit30 | %MX30 | ||||
Bit31 | %MX31 | ||||
Bit32 | %MX32 | %MB5 | %MW2 | %MD1 | |
Bit33 | %MX33 | ||||
Bit34 | %MX34 | ||||
Bit35 | %MX35 | ||||
Bit36 | %MX36 | ||||
Bit37 | %MX37 | ||||
Bit38 | %MX38 | ||||
Bit39 | %MX39 | ||||
Bit40 | %MX40 | %MB6 | |||
Bit41 | %MX41 | ||||
Bit42 | %MX42 | ||||
Bit43 | %MX43 | ||||
Bit44 | %MX44 | ||||
Bit45 | %MX45 | ||||
Bit46 | %MX46 | ||||
Bit47 | %MX47 | ||||
Bit48 | %MX48 | %MB7 | %MW3 | ||
Bit49 | %MX49 | ||||
Bit50 | %MX50 | ||||
Bit51 | %MX51 | ||||
Bit52 | %MX52 | ||||
Bit53 | %MX53 | ||||
Bit54 | %MX54 | ||||
Bit55 | %MX55 | ||||
Bit56 | %MX56 | %MB8 | |||
Bit57 | %MX57 | ||||
Bit58 | %MX58 | ||||
Bit59 | %MX59 | ||||
Bit60 | %MX60 | ||||
Bit61 | %MX61 | ||||
Bit62 | %MX62 | ||||
Bit63 | %MX63 |
Use the Address Calculator in XG5000 to help with conversion between data types.
LP003-2