5.27. VxWorks SNARF - emllSNARF
Using the EtherCAT master stack’s Real-time Ethernet Driver SNARF it is possible to use any of the standard network drivers shipped with VxWorks. In VxWorks every network adapter is identified using a short string and a unit number in case of multiple identical network adapters. The unit numbers start with a value of 0. For example the string for the Intel Pro/100 network adapter driver is “fei”. The first unit is identified using the string “fei0”:
The network adapter driver has to be loaded prior to initialize the EtherCAT master stack.
Using the Real-time Ethernet Driver SNARF has some disadvantages. As the VxWorks network layering is involved in this architecture, the drivers are usually not optimized for realtime behavior the needed CPU time is often too high to reach cycle times less than 300 to 500 microseconds. Additionally there is an impact if in parallel to EtherCAT traffic the VxWorks application needs to use a second network card for transferring TCP/IP data. The single tNetTask is shared by all network drivers. Using a dedicated EtherCAT driver these disadvantages can be overcome.
The parameters to the Real-time Ethernet Driver SNARF are setup-specific. The function CreateLinkParmsFromCmdLineSNARF()
in EcSelectLinkLayer.cpp
demonstrates how to initialize the Real-time Ethernet Driver instance.
-
struct EC_T_LINK_PARMS_SNARF
Public Members
-
EC_T_LINK_PARMS linkParms
Common link parameters. Signature must be set to EC_LINK_PARMS_SIGNATURE_SNARF
-
EC_T_LINK_PARMS linkParms
#include "EcLink.h"
EC_T_LINK_PARMS_SNARF oLinkParmsAdapter;
OsMemset(&oLinkParmsAdapter, 0, sizeof(EC_T_LINK_PARMS_SNARF));
oLinkParmsAdapter.linkParms.dwSignature = EC_LINK_PARMS_SIGNATURE_SNARF;
oLinkParmsAdapter.linkParms.dwSize = sizeof(EC_T_LINK_PARMS_SNARF);
OsStrncpy(oLinkParmsAdapter.linkParms.szDriverIdent,
EC_LINK_PARMS_IDENT_SNARF, MAX_DRIVER_IDENT_LEN - 1);
OsStrncpy(oLinkParmsAdapter.szAdapterName, "fei0", MAX_DRIVER_IDENT_LEN - 1);