3.2. Process data update and synchronization

The EtherCAT® MainDevice cyclically sends frames containing the outputs of the Process Data Image to the EtherCAT® network and the Simulator synchronizes the Process Data Image with the frames from the MainDevice and sends the response back to the MainDevice. The MainDevice cyclically receives the inputs of the Process Data Image from the Simulator.

Diagram showing the EtherCAT MainDevice cyclically sending frame outputs and the EC-Simulator receiving, simulating, and returning process data inputs

The HiL Application directly accesses the Process Data Image at Simulator:

Diagram showing the EC-Simulator HiL application directly accessing the Process Data Image

3.2.1. Forced Data, Firmware Data, DPRAM

The EC-Simulator stack synchronizes the outputs and inputs from the Process Data Image and the SubDevice DPRAM areas containing process data objects individually.

Diagram showing the EC-Simulator stack synchronizing outputs, inputs, DPRAM areas, and process data objects individually for forced data and firmware data simulation

3.2.2. EC-Simulator stack as process data memory provider

By default the EC-Simulator stack internally allocates the memory needed to store input and output process data values.

Diagram showing the EC-Simulator stack as the default process data memory provider, internally allocating separate input and output memory areas for the application

In order to update process data, the application’s JobTask has to call:

  • eUsrJob_ProcessAllRxFrames (polling mode only)

    Process all received frames from Real-time Ethernet Driver

  • eUsrJob_SimulatorTimer

    Trigger state machines

Important

In polling mode, the MainDevice cycle time must be at least two times higher than the simulator cycle time. E.g. if the simulator runs with 1 ms, the MainDevice cycle time must be at least 2 ms. If the Real-time Ethernet Driver is running in interrupt mode (non-standard), processing of received frames is done immediately after the frame is received.

See also

EC_T_SIMULATOR_INIT_PARMS::bDisableProcessDataImage at esInitSimulator() (HiL) or EC_T_LINK_PARMS_SIMULATOR::bDisableProcessDataImage (SiL) for how to disable allocation and usage of the process data image.

3.2.2.1. Cyclic frames - Real-time Ethernet Driver in polling mode

Diagram showing the cyclic frame processing sequence in polling mode with ProcessAllRxFrames and SimulatorTimer jobs in the application job task

Application has to perform:

/* Job 1: incoming process data is stored to Process data image (polling mode only) */
esExecJob(dwSimulatorInstanceId, eUsrJob_ProcessAllRxFrames, &bPrevCycProcessed);
...
...
/* do process data cycle */
...
...
/* Job 2: trigger state machines, which are necessary to perform any status change or internal administration tasks */
esExecJob(dwSimulatorInstanceId, eUsrJob_SimulatorTimer, EC_NULL);

For closer details find an example project “EcSimulatorHilDemo” in the folder “Examples”.