5.22. VxWorks SNARF - emllSNARF

Using the EtherCAT master stack’s SNARF Link Layer 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 SNARF Link Layer 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 SNARF Link Layer are setup-specific. The function CreateLinkParmsFromCmdLineSNARF() in EcSelectLinkLayer.cpp demonstrates how to initialize the Link Layer instance.

Public Members

Common link parameters. Signature must be set to EC_LINK_PARMS_SIGNATURE_SNARF

SNARF adapter name (zero terminated)

Receive buffer count, only used in RTP context, 0: default to 20

#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.szAdapterName, "fei0", MAX_DRIVER_IDENT_LEN - 1);