EtherCAT

Slave Interface

The incoming EtherCAT signal is connected to the interfaces X101. X102 goes to further EtherCAT Slave devices. The 10-pole DIP switch is intended exclusively for the “Hot Swap” (see Hot Swap). A maximum of 512 bytes of input and output data or 256 variables can be connected via the EtherCAT interface.

For example, the creation of 512 bytes cannot work, because 512 variables would be required for it.

Process data

How is the process data created in TwinCAT?

The System Manager adds an “EtherCAT Slave” device as soon as a CX8010 is scanned. The interface has a very simple structure and usually consists only of “inputs”, “outputs” and InfoData. If you click on the inputs you can add data to the interface with the right mouse button. The system then automatically addresses them.

EtherCAT 1:

EtherCAT 2:

The same is done with the outputs. Now link them to your PLC program or to the K-bus and/or E-bus terminals. If you only link from terminals to the EtherCAT process image, make sure that both devices possess a task that they trigger and that the task is also automatically started.

InfoData: The current AMSNet ID of the interface is stored here. You can evaluate the state in order to determine the state of the EtherCAT slave interface.

Process data with structures

In order to save a large number of links it is a good idea to use a data structure to save data that you wish to exchange. Note here, however, that an x86 system and an ARM processor will handle data structures with different variables in a different way. The ARM processor always places Word variables (2 bytes) at an even address and 4 DWORD variables (4 bytes) at an address that is divisible by 4.

Example

Data structure

    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 byte

Sum 5 bytes

You can determine the length of a data structure on both systems using the command SIZEOF. If there is a difference here, this indicates that something is wrong with the data structure.

This problem can be solved by more skillful arrangement of the variables or by working with filler or 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 byte

Sum 8 bytes

Device status

The device status indicates whether the EtherCAT Slave interface is in OP mode and indicates the data communication via the toggle bit. The EtherCAT status can also be affected by the slave side in the output area.

EtherCAT 3:
EtherCAT 4:

TxPDO State “1”: node is in OP mode; “0”: node is no longer in OP mode

TxPDO Toggle “1/0”: node is in data exchange

AIStatus Control

0x0000_0000    Normal mode (OP mode)
0x0001_0000    INIT mode
0x0002_0000    PREOP mode
0x0004_0000    SAFEOP mode
0x0008_0000    OP mode

All other bits are reserved!

Hot Swap (Explicit Device Identification)

In applications in which a CX8010 is to be replaced by another CX8010 during operation (with different applications on the respective CX8010), the individual CX8010s can be distinguished from each other with Explicit Device Identification. These are sorted into a Hot-Connect group.

The Explicit Device Identification Number can be set using the DIP switch or by software in the System Manager. If it is to be used via the DIP switch, it must be activated once in the System Manager. When starting the system the CX8010 then leaves the switch on and operates with its setting.

EtherCAT 5:

ADS Interface AMS NetId

Reserved for extensions.

Advanced Settings

Reserved for extensions.

Distributed Clocks

Not currently supported.