The EC-Monitor currently supports a variety of different Link Layer modules, each of which contained in a single library file, which is loaded by the core library dynamically. The EC-Monitor shipment consist of a core library and one (or more) libraries each containing support for one specific Link Layer module (type of hardware card).
Which library actually is loaded, is depending on the Link Layer parameters at runtime.
The principle of Link Layer selection is that the name of the Link Layer (Link Layer Identification) is used to determine the location and name of a registration function, which is called by the EC-Monitor and registers function pointers which allow access to the Link Layer functional entries.
The EtherCAT Link Layer will be initialized using a Link Layer specific configuration parameter set.
A pointer to this parameter set is part of the EC-Monitor initialization settings.
The EC-Monitor supports two Link Layer operating modes.
If the Link Layer operates in interrupt mode all received Ethernet frames will be processed immediately in the context of the Link Layer receiver task.
When using the polling mode the EC-Monitor will call the Link Layer receiver polling function prior to processing received frames.
7.1.1. Optimized Link Layer drivers
Optimized means operating directly on the network device’s register set instead of using the operating system’s native driver.
7.1.2. Optimized Link Layer drivers and PHY OS Driver
Some operating systems, e.g. Linux and Xenomai, provide drivers for most common Ethernet controllers and their related physical transceivers (PHY).
The manufacturer specific PHY circuits can be handled by a dedicated driver.
Using the PHY OS Driver interface it is possible to use the manufacturer’s dedicated PHY driver without modification of the acontis optimized Link Layer driver.
Depending on the hardware architecture, an additional module from acontis, e.g. atemsys for Linux, grants access to the MDIO bus to the OS drivers, or request MDIO operations from the OS drivers.
Link Layer modules not listed here may be available if purchased additionally
7.1.3. Link Layer selection and initialization
The different Link Layer modules are selected and parameterized by a common structure EC_T_LINK_PARMS shared by all Link Layers and a Link Layer specific structure, pointed to by an element within the common structure. This parameter set is given to EC_T_INIT_MONITOR_PARMS::pLinkParms with the call of emInitMonitor().
[in] Time between pfnStartCycle call and frame transmission
[in] Callback function called cyclically according dwCycleTimeUsec
[in] Context passed to each pfnTtsStartCycle call
7.1.4. Link Layer instance selection via PCI location
For some operating systems it is possible to address the Link Layer instance using its PCI address as an alternative. To do this, EC_LINKUNIT_PCILOCATION (0x01000000) and the PCI location must be set as EC_T_LINK_PARMS::dwInstance.