Skip to content

Simulation Reset

A SimulationReset component restarts the scene when a boolean PLC output rises. The reset is the same one the Reset button in the simulation controls runs: parts are removed, drives return to their start pose and the logic starts again. Use it when a controller, a Structured Text program or an MQTT source must bring the twin back to a known state, for example after a test cycle or when an operator confirms a restart on the real panel.

The component can also report back. SignalResetDone goes true for a short time after the reset it requested has run, so the controller knows the twin is ready.

For a reset from an operator panel, you do not need this component. Give a panel button the command sim.reset instead, see Operator Panel.

Signal Reset (ComponentReference to PLCOutputBool) The signal that triggers the reset. Its rising edge, false to true, resets the simulation once. Link it in the inspector. Without a signal the component does nothing.

Signal Reset Done (ComponentReference to PLCInputBool) Optional feedback signal. The viewer writes it true for Done Pulse Time after a reset that this component requested has run, then false again. Leave it empty if the controller needs no confirmation.

Min Interval (number, at least 0, seconds, default 1) The minimum real time between two signal-triggered resets. It guards against a controller that requests a reset in a loop. The interval is measured on the wall clock, because the simulation time jumps back to 0 on every reset and stands still while the simulation is paused.

Done Pulse Time (number, at least 0.01, seconds, default 0.2) The length of the Done pulse, measured in simulation time. While the simulation is paused, the pulse does not progress.

Only a rising edge counts. The level the viewer reads when the signal is first linked, a level that is re-applied after a reset or after an interface reconnects, and the first value of an interface that has not synchronised yet never trigger a reset. They only set the starting point for the next edge.

One reset per request. The reset runs right after the current simulation tick, never in the middle of it. Several requests in the same tick, from one or more components, produce one reset. It also runs while the simulation is paused.

A held request does not repeat. After every reset, whatever triggered it, the signal must be seen low before its next rising edge counts. A controller that keeps the request true through the reset therefore cannot trigger a second one, even if the reset sets the signal back to its start value. A request that was low throughout stays ready.

Minimum interval. A request that arrives before Min Interval has passed since the last reset is ignored.

Done pulse. After the reset has run, Signal Reset Done is true for Done Pulse Time. It means that the viewer has reset the twin. It does not mean that a controller has restarted. A reset triggered by a button, the keyboard or the AI bridge does not set the pulse, unless a component also requested it.

Both connection modes. The component works in Simulation mode and in PLC mode, as it reads and writes ordinary signals. The reset does not write to signals that an interface, a binding or a force controls.

If the reset is refused, the request is dropped, a warning appears in the browser console and the Done signal stays false.

Reset handshake between a controller and the twin A sequence between an external controller and the SimulationReset component. Step 1: the controller sets the request signal, a rising edge on Signal Reset. Step 2: after the current simulation tick the viewer resets the twin once; parts are removed, drives return to the start pose and the logic starts again. Step 3: Signal Reset Done is true for Done Pulse Time. Step 4: the controller sees Done and clears the request, so the next rising edge can reset again. Controller Twin (SimulationReset) 1 Signal Reset rises (false to true) 2 Reset runs once right after the current tick, even when paused: parts removed, drives to start pose, logic restarts 3 Signal Reset Done true for Done Pulse Time 4 Done seen: request cleared (signal low) Only a rising edge counts; the signal must be low again before the next reset.
The request is cleared only after Done, which makes the signal low again for the next reset.

The program requests a reset when the operator presses the key on the real panel, waits for the Done pulse and then withdraws the request. S_ResetReq is linked to Signal Reset and S_ResetDone to Signal Reset Done:

PROGRAM Main
VAR_EXTERNAL
OpKeyReset : BOOL; (* @signal: S_KeyReset *)
ResetReq : BOOL; (* @signal: S_ResetReq *)
ResetDone : BOOL; (* @signal: S_ResetDone *)
END_VAR
VAR
trig : R_TRIG;
END_VAR
trig(CLK := OpKeyReset);
IF trig.Q THEN
ResetReq := TRUE; // 1. set the request
END_IF;
IF ResetReq AND ResetDone THEN
ResetReq := FALSE; // 3. Done seen: clear the request
END_IF;
// 2. between the two steps the twin resets and then pulses ResetDone
END_PROGRAM

Clearing the request is what makes the signal low again. The next rising edge then resets the simulation once more.

  1. Create two signals with Quick Edit: a PLC Output Bool for the request, for example S_ResetReq, and optionally a PLC Input Bool for the feedback, for example S_ResetDone.
  2. Add SimulationReset to any node, conventionally the scene root. In the component menu it is listed as Simulation Reset.
  3. Link Signal Reset to the output signal. Link Signal Reset Done to the input signal if the controller needs the confirmation.
  4. Leave Min Interval at 1 s and Done Pulse Time at 0.2 s. Raise the pulse time if the controller scans slowly.
  5. Run the simulation, set the request signal to true, for example by forcing it, and watch the scene return to its start state.
Continuous simulationDES (event-driven)
AvailableYesYes
When the request is evaluatedWhen the signal value reaches the viewer. The reset runs right after the current tickWhen the signal value reaches the viewer. The reset runs right after the current evaluation
After the resetThe simulation keeps runningThe run stops at time 0 and waits for Play, as after any reset in DES
Done pulseCounts down in simulation time, on every tickEnds on the event clock at the pulse deadline. It does not progress while the run is paused, so after a reset it ends after Play
SnapshotsNot affectedSaving or loading a snapshot is refused while the Done pulse is open. Wait until it has ended
Switching mode during a pulseThe pulse continues on the new clockThe pulse continues on the new clock