
AXC 1050 (XC)
112
PHOENIX CONTACT
8482_en_03
7.15
Alignment
The alignment of the data elements in the controller memory can result in "data gaps" when
storing data in the memory. The compiler automatically fills these gaps with padding bytes
during the compilation process in order to prevent incorrect processing.
The disadvantage of the automatic filling of data gaps becomes apparent when data is
transmitted from the controller to another controller. If this controller does not know the
memory algorithm of the controller, it will interpret the received data incorrectly.
It is therefore useful to program the filling of data gaps in your application program. Alterna-
tively, you can use the PACK and UNPACK function blocks (see online help in PC Worx).
Data transmissions to other controllers can therefore be taken into consideration. For exam-
ple, use byte arrays with an even number of bytes and/or word arrays in order to avoid data
gaps in your application program.
Please observe the following notes for program creation:
•
Create data types in flat structures, i.e., do not nest user-defined data types.
•
Insert padding bytes manually in order to ensure the uniform size and layout of the data
types.
•
When inserting padding bytes, observe the memory alignment method of the control-
lers used in the application (1-byte, 2-byte or 4-byte alignment).