Skip to content

AI Commissioning

An AI assistant connected through the AI bridge can commission a station much like an engineer. It operates the operator panel, waits for the machine to react, looks at where the PLC sequence is waiting and compares a run of the virtual PLC with a run of the real controller. Five commands cover this. They change nothing in the model and never become part of the undo history or a macro.

CommandWhat it does
operatorPanel.pressPresses a button or turns a selector switch on the operator panel, like an operator
sim.waitForWaits until a signal reaches a value, for up to 60 seconds
plc.chainStatusShows the active step of each sequence chain, how long it has been active and what it is waiting for
signal.trace.*Records the value changes of signals and compares two recordings
signal.reconcileChecks signal directions before the first write: where the model writes a PLC output

operatorPanel.press works a device of the station’s operator panel. The assistant names the device by its signal, label or legend. A push button is held for 300 ms (up to 5 s) and then released. A selector switch is turned to the named position, for example AUTO.

The press uses the same path as a mouse click. With Show AI clicks switched on, the panel shows the button pressed while the assistant holds it. The press works even when the panel window is closed. With an external PLC the press reaches the controller through CONNECT as a PLC input, exactly like a click.

An emergency stop works like on the real panel: one press pushes it in and it stays pressed, a second call with the position released releases it, and the acknowledge button clears the fault. This lets the assistant test the complete E-stop chain during virtual commissioning.

A button that runs a command, such as a Reset button bound to sim.reset, runs that command when the assistant presses it, exactly as it does on a click.

One kind of device is never pressed: a device whose signal is a PLC output or forced. An operator device writes only a PLC input, and a force always wins.

The button is released after the hold time, on an error, when the model changes and when the simulation is reset.

sim.waitFor waits until a signal meets a condition, for example SIM_AutoRelease == true or Position >= 120. It returns as soon as the condition holds, or after its timeout. The timeout counts real time, 20 seconds by default and at most 60. For a longer wait, the assistant asks again. The answer says whether the condition was met, the current value, the simulation time and why the wait ended: the condition was met, the time ran out, the model changed, the simulation was reset or the signal does not exist.

plc.chainStatus reads the step chains of the virtual PLC program. A chain is a CASE over a step variable whose steps move on by assigning the next step number:

CASE Step OF
0: IF Start AND PartPresent THEN Step := 10; END_IF;
10: Clamp := TRUE; Step := 20;
20: IF tClamp.Q THEN Step := 30; END_IF;
END_CASE;

For each chain the answer shows the active step and how long the chain has been in it. It also lists every transition out of that step, with its condition as written in the program and the current value of each operand, for example tClamp.Q = FALSE. The step time is recorded with every PLC scan, so it is exact even when the PLC editor is closed. Chains in another form are listed with their line as unsupported rather than guessed.

When a real controller has taken over, the assistant can only see what is coupled to it. The step comes from the step variable only when that variable is a coupled signal. Operands that are not coupled, such as local timers, are shown as unknown. A value of the local program is never shown as the controller’s value. The answer always states that the controller’s program could not be verified against the twin.

signal.trace.start records every value change of up to 64 signals in the browser tab, together with the simulation time. Typical use is one recording with the virtual PLC and one with the real controller. signal.trace.compare then compares the sequence of values signal by signal, including the value at the start. It reports the first point where the two runs differ. A run that does the same thing later or more slowly counts as equal. Its time shift is shown as information.

Recordings stay in the tab and are not saved. A recording stops after 600 seconds or 200 000 changes. Up to four recordings are kept, and loading another model removes them. For long-term recording use the data recording of CONNECT.

The PLC writes its outputs and reads its inputs. When the model also writes a PLC output, the model and the controller write the same signal. With a real controller that leads to flickering values or a machine that does not move. signal.reconcile finds these places before the first write, even without a CONNECT gateway:

  • a component that writes back to a signal that is a PLC output,
  • plant logic that keeps running with an external PLC and sets a PLC output,
  • an ST program that assigns a PLC input.

The virtual PLC writing its own outputs is correct and is not reported. Writes that already happened are listed separately. With CONNECT connected, the same answer also contains the direction and type comparison with each interface.

Continuous simulationDES (event-driven)
operatorPanel.pressHolds the button for the hold time in real timeSame; in fast-forward much more simulation time can pass during the hold
sim.waitForTimeout in real time; reports the simulation timeSame; the simulation time is the DES event time
plc.chainStatusStep recorded with every scanStep recorded with every DES scan; step times are simulation seconds, which can jump
signal.trace.*One sample per value change, with simulation and real timeSame, with the DES event time
signal.reconcileStatic check, independent of the modeSame