5. Link Layer
The EC-Simulator stack 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.
Which library actually is loaded, is depending on the Link Layer parameters at runtime.
The principle of the Link Layer selection is that the Link Layer name (Link Layer identification) is used to determine the location and name of a registration function called by EC-Simulator and registers function pointers that 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 EC-Simulator’s initialization settings when calling the function
EC-Simulator 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.
In polling mode, the application must cyclically call
esExecJob() with job
eUsrJob_ProcessAllRxFrames in order to trigger EC-Simulator to call the Link Layer receiver polling function and process received frames.
In polling mode, the master cycle time must be at least two times higher than the simulator cycle time. E.g. if the simulator runs with 1 ms, the master cycle time must be at least 2 ms. If the Link Layer is running in interrupt mode (non-standard), processing of received frames is done immediately after the frame is received.
Optimized Link Layer drivers
Optimized means operating directly on the network device’s register set instead of using the operating system’s native driver.
Link Layer modules not listed here may be available if purchased additionally. Not all Link Layer modules support interrupt mode.