7.3. Windriver VxWorks
Real-time Ethernet Driver for VxWorks are available. If none of the Real-time Ethernet Driver can be used, the SNARF Ethernet Driver must be selected.
7.3.1. VxWorks native
The BSP has to be prepared to support Real-time Ethernet Driver:
To use a Real-time Ethernet Driver the adapter memory has to be mapped into VxWorks memory space (VxWorks 5.x only). I.e. for the Intel Pro/100 Ethernet Driver this can be achieved by setting the INCLUDE_FEI_END macro in the BSP configuration file config.h.
To avoid conflicts with the VxWorks network driver which normally will be loaded when INCLUDE_FEI_END is set the file configNet.h has to be adjusted in a way that the network driver is not loaded. The network driver entry has to be removed from the endDevTbl[]:
END_TBL_ENTRY endDevTbl [] =
{
: : :
: : :
: : :
/*
#ifdef INCLUDE_FEI_END
{0, FEI82557_LOAD_FUNC, FEI82557_LOAD_STRING, FEI82557_BUFF_LOAN,
NULL, FALSE},
#endif /* INCLUDE_FEI_END */
*/
: : :
: : :
Warning
Do not call muxDevUnload()
for a device managed by a VxBus driver. VxBus drivers expect to call muxDevUnload()
themselves in their {vxbDrvUnlink}( ) methods, and instability may result if muxDevUnload()
is called for a VxBus network device instance by other code.
See also
The VxWorks Device Driver Developer’s Guide for more information about unloading VxBus network devices
7.3.2. SNARF Ethernet Driver
The SNARF Ethernet Driver is only needed if none of the Real-time Ethernet Driver can be used. The appropriate network adapter drivers have to be added to the VxWorks image.
7.3.3. Setting up and running EcMonitorDemo
- VxWorks OS configuration
See sections above.
- Determine the network interface
Using the command line option the network interface card and Real-time Ethernet Driver to be used in the example application can be determined.
- Connection of the EtherCAT® slaves
The slaves have to be connected with the VxWorks system using an Ethernet switch or a patch cable. Local IT infrastructure should not be mixed with EtherCAT® modules at the same switch as the EC-Monitor will send many broadcast packets! EtherCAT® requires a 100Mbit/s connection. If the VxWorks network adapter card does not support this speed an 100Mbit/s (!) Ethernet switch has to be used.
- Download an Real-time Ethernet Driver module
The Real-time Ethernet Driver library (e.g.
emllIntelGbe.out
) which contains hardware support for the corresponding NIC must be downloaded. By default the Ethernet Driver emllSnarfGpp are contained with the binary delivery.
- Download the example application
The target has to be started and a target-server connection will have to be established. After this the example application can be downloaded into the target.
- Set up a FTP server connection on host
The demo application needs to load a XML file (
eni.xml
) for the configuration of the master. This file can be accessed using a FTP server. The screen shot below show, how to configure the FTP server. The directory contents can be checked via FTP using thels
command. The fileeni.xml
will have to be accessed using the default directory.
- Check for exclusive hardware access
Be sure that the network adapter instance dedicated to EtherCAT® is not controlled by a VxWorks driver, this can be verified using:
muxShow
If it is needed, first unload the driver using: (e.g. first instance of the Intel Pro/100):
muxDevUnload "fei", 1
(e.g. second instance of the Intel Pro/1000):
muxDevUnload "gei", 2
(e.g. first instance of the Realtek 8139):
muxDevUnload "rtl", 1
(e.g. first instance of the Realtek 8169):
muxDevUnload "rtg", 1
- Run the example application
The downloadable module
EcMonitorDemo.out
has to be executed. The configuration fileeni.xml
will be used and thus has to be accessible in the current working directory. The appropriate Real-time Ethernet Driver and network adapter card have to be selected. If the log files shall be written the global variablebLogFileEnb
has to be set to 1 prior to starting the demo.Loading and running the demo:
ld<EcMonitorDemo.out sp EcMasterAppMain,"-intelgbe 1 1 -f eni.xml"
Example:
See also
7.3.4. OS Compiler settings
Besides the general settings from Compiling the EcMonitorDemo the following settings are necessary to build the example application for VxWorks.
- Extra include paths
<InstallPath>/SDK/INC/VxWorks <InstallPath>/Examples/Common/VxWorks
- Extra source paths
<InstallPath>/Examples/Common/VxWorks <InstallPath>/Sources/OsLayer/VxWorks
- Extra library paths to the main EtherCAT® components
<InstallPath>/SDK/LIB/VxWorks/<ARCH>