OnSimulationStart

Description

This event is invoked when the simulation starts. It can be used to subscribe to events or initialize property values.

The global event is automatically created when creating a new project.

Note: for large projects or projects that include a number of device connections, there may be a considerable delay in establishing the connections. When the OnSimulationStart function is called the devices may not have connected and any MoveProduct command may be compromised. To work around this, the code in the OnSimulationStart function call can be called after a delay (e.g. 5 seconds after starting)

Event

void OnSimulationStart()

Parameters

None.

Return Value

None.

Example

function OnSimulationStart() {

    LogDebug("OnSimulationStart called");
    SetTimerEx(1024, 5000, OnSimulationStartDelayed, null);
}

function OnSimulationStartDelayed() {

    LogDebug("OnSimulationStartDelayed called");
}