Simulate Process Data by swapping Inputs and Outputs

EtherLab, since version 2.4.0, can also be used to simulate the Process Data of EtherCAT Slaves, which is useful to build a simulator for an control application. The control application does not need to be modified, because the same interface as the EtherCAT master is used.

The simulator application uses the same EtherCAT blocks as the control application, but with their Inputs and Outputs swapped. So a block representing an Digital Output actually has a Simulink Output which will be controlled by the control application. To swap the ports, please check the Swap Inputs and Outputs of EtherCAT blocks for simulating Process Data with libfakeethercat Option in EtherLab C code generation options section of your simulator model configuration (Ctrl+E).

Both applications use libfakeethercat to exchange the Process Data. This library has a subset of the libethercat API, but uses RtIPC to communicate between both applications. Please refer to the EtherCAT Documentation to learn about how to set up libfakeethercat.