5.28. Linux SockRaw - emllSockRaw

The Real-time Ethernet Driver SockRaw is always part of the EC-Master for Linux package. It does not need the atemsys driver and uses already established Ethernet adapters, e.g. eth0, eth1, etc. It is strongly recommended to use a separate network adapter to connect EtherCAT devices. If the main network adapter is used for both EtherCAT devices and the local area network there may be a main impact on the local area network operation.

Note

The SockRaw cannot be used for real time applications and may need cycle time of 4 ms or higher. Root privileges are required.

To run the application without root privileges, set the Linux capability ‘cap_net_raw’ to the application.

sudo setcap 'cap_net_raw+pe' ./EcMasterDemo

To run python scripts without root privileges, create a python environment and set the Linux capability ‘cap_net_raw’ to the python interpreter.

cd Bin/Linux
python3 -m venv --copies PyEnv/
source PyEnv/bin/activate
sudo setcap 'cap_net_raw+pe' PyEnv/bin/python3

The parameters to the Real-time Ethernet Driver SockRaw are setup-specific. The function CreateLinkParmsFromCmdLineSockRaw() in EcSelectLinkLayer.cpp demonstrates how to initialize the Real-time Ethernet Driver instance.

Public Members

Common link parameters. Signature must be set to EC_LINK_PARMS_SIGNATURE_SOCKRAW

Native ETH device name, e.g. “eth0” (zero terminated)

Don’t change target MAC address to FF:FF:FF:FF:FF:FF

Prevent adding Ethernet padding to work-around EtherCAT corruption bugs from native Linux driver(s).

Use PACKET_MMAP PACKET_RX_RING for receive

Set Coalescing parameters to enhance the link layer performance