Ethernet over EtherCAT (EoE) transparently tunnels standard Ethernet communication via EtherCAT. Tunneling allows the master device to optimize Ethernet communication without affecting the process data communication. EoE enables communication with network devices. EoE is typically used for devices with TCP/IP stack, such as a web server, or for infrastructure devices such as switch ports, to which peripheral devices can be connected.
The motivation of the code snippets is to provide a better understanding of how to configure and transport the Ethernet frames. For a detailed overview please refer to the example code.
Register a function for network settings. The function is called when the EtherCAT master sends an EoE frame with the network device settings (IP address, Gateway, MAC address and DNS server). These parameters must be given then to the users virtual network interface.
This function registers a function which must be implemented by the user. The user defined function is called any time an EoE frame is received.
Use this function to send Ethernet frames over the EtherCAT network.
Set an IP address to the EtherCAT network interface.
Enable Virtual Ethernet Switch and the TCP/IP Stack connection for the EtherCAT Master on TwinCAT.
Enable Virtual Ethernet Port and set an IP address to the EtherCAT slave. The default gateway must the EtherCAT network interface IP address.
The EtherCAT slave simple demo implements EoE protocol for AM64x EVM with the Linux SDK. The application creates a Linux TAP device (a virtual network interface) and the IP configuration are set by the EtherCAT master.
Restart the communication on TwinCAT with the EoE settings. If the application and the IP configuration are correct, once the slave is brought to PreOP state, then the virtual network interface should be available.
Therefore, now it should be possible to ping the device or to open an SSH communication.
For troubleshooting is highly recommended to use Wireshark.