Creating process data
Up to 512 bytes of input and output data or 256 variables can be exchanged via the EtherCAT slave interface (X101, X102). The 512 bytes of input and output data cannot be created individually, since 512 variables are required for this.
To avoid an excessive number of links, it makes sense to store data in a data structure. Note that the data structures used are processed differently on an x86 system and an ARM processor. For example, the ARM processor always places WORD variables (2 bytes) on an even address and DWORD variables (4 bytes) on an address that can be divided by 4.
Data structure sample:
byTest :BYTE;
udTest:UDINT;
ARM address | ARM variable | Address x86 | ARM variable |
---|---|---|---|
Byte Offset 0 | Byte | Byte Offset 0 | BYTE |
Byte Offset 4 | UDINT | Byte Offset 1 | UDINT |
Sum: 8 bytes | Sum 5 bytes |
You can determine the length of a data structure on both systems using the command SIZEOF. If the length of the data structure is different, this indicates that the data structure is unsuitable.
You can solve the problem by smarter arrangement of the variables or by using dummy variables.
ARM address | ARM variable | Address x86 | ARM variable |
---|---|---|---|
Byte Offset 0 | Byte | Byte Offset 0 | BYTE |
Byte Offset 1 | BYTE (Dummy1) | ||
Byte Offset 2 | BYTE (Dummy2) | ||
Byte Offset 3 | BYTE (Dummy3) | ||
Byte Offset 4 | UDINT | Byte Offset 4 | UDINT |
Sum: 8 bytes | Sum 8 bytes |
Create process data as follows:
- 1. Under Devices in the tree view on the left, right-click on Inputs to create input variables.
- 2. Click on Add New Item in the context menu. The Insert Variable menu appears.
- 3. Select the required variables and confirm with OK. Click the Create Array Type button to create data structures.
- You have successfully created input variables. Repeat the steps to create output variables in the same way.