Technical FAQs

Ask a Question

Unity Pro : why the mapping of DDT can be different between M580/M340 and simulator.

It is due to the storage alignment in M580/M340.
To be sure that the application does not contain such problem, check in the "Project setting" in the "General Tab" and the "Warning field", the "DDT Mapping Compatibility" option. With this option on a build, a warning will be displayed if the mapping is different between M580/M340 and simulator.

Example of mapping difference :
On simulator :
Inst_my_DDT My_DDT %MW10
- My_word INT %MW10
- my_Dword DINT %MW11

On M340/M580 :
Inst_my_DDT My_DDT %MW10
- My_word INT %MW10
- my_Dword DINT %MW12 <= mapping rule

To avoid this kind of situation it is advised to put all double words (Real, DINT... at the begining of the DTT it is also a way to optimize the number of %MW consumed).

Here after extract of the documentation which explains the M580/M340 mapping rule :

Principle for Modicon M580/M340

The storage principle for Modicon M580/M340 PLCs is as follows:
- Elements are stored in the order in which they are declared in the structure,
- The basic element is the byte,
- One alignment rule and function of the element:
- the BOOL and BYTE types are aligned on either even or uneven bytes,
- the INT, WORD and UINT types are aligned on even bytes,
- the DINT, UDINT, REAL, TIME, DATE, TOD, DT and DWORD are aligned on double words,
- structures and tables are aligned according to the rules of their elements

Warning :
Bad exchanges between a Modicon M580/M340 project and a Premium or Quantum project.
Check if the structure of the exchanged data have the same alignments in the two projects.
Otherwise, the data will not be exchanged properly.
Failure to follow these instructions can result in death, serious injury, or EQUIPMENT damage.

Note: It is possible that the alignment of data are not the same when the project is transferred from the simulator of Unity Pro to a M580/M340 PLC. So check the structure of the data of the project.
Note: Unity Pro indicates where the alignments seems to be different. Check the corresponding instances in the data editor. See the page of Project settings to know how enable this option.

Was this helpful?
What can we do to improve the information ?