A direct address specified in EcoStruxure Machine Expert contains the following information:
Information on the memory location.
Memory format (size)
Offset of the memory location. The offset is specified by an integer number, which in case of a bit address is followed by a dot and a number for the position of the bit.
%<memory area prefix><size prefix><number|.number|.number....>
The following memory area prefixes are supported:
|
input (physical inputs via input driver, sensors) |
|
output (physical outputs via output driver, actors) |
|
memory location |
The following size prefixes are supported:
|
single bit |
|
byte (8 bits) |
|
word (16 bits) |
|
double word (32 bits) |
Example address |
Description |
---|---|
|
output bit 7.5 |
|
|
|
input word 215 |
|
output byte 7 |
|
double word in memory position 48 in the memory location |
|
example of a variable declaration including an address assignment
For further information, refer to the |
AT %I
, %Q
and %M
) is predefined by the target device and can be overwritten in the properties of an application object for PacDrive controllers (PacDrive LMC Eco, PacDrive LMC Pro/Pro2).
Devices either use byte addressing mode or word addressing mode.
Examples
Mode |
Example |
---|---|
Byte addressing |
|
Word addressing |
|
The range for the second element of the bit address that is the number following the dot, is as follows:
byte addressing mode: 0...7
word addressing mode: 0...15
Also for the handling of bit addresses, you can configure the devices differently. They are then interpreted correspondingly by the EcoStruxure Machine Expert compiler.
Example: In a byte-addressing device, the bit address %IX2.5
addresses byte 2 (IB2
). In a word-addressing device, however, it addresses word 2, which refers to a different location within the memory.
varbool1 AT %QB7
affects the range from QX0.0
to QX0.7
.