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.
-
struct EC_T_LINK_PARMS_SOCKRAW
Public Members
-
EC_T_LINK_PARMS linkParms
Common link parameters. Signature must be set to EC_LINK_PARMS_SIGNATURE_SOCKRAW
-
EC_T_CHAR szAdapterName[EC_SOCKRAW_ADAPTER_NAME_SIZE]
Native ETH device name, e.g. “eth0” (zero terminated)
-
EC_T_LINK_PARMS linkParms