Debugging

Step through PLC execution, watch variables, and diagnose issues

Debugging

Sim Assist includes a full debugging environment for PLC programs. You can step through scan cycles, inspect variable values, set breakpoints, and monitor system diagnostics — all within the browser.

Step Debugging

Step debugging lets you advance the PLC program one scan cycle at a time, giving you full control over execution:

  1. Start the simulation and click Pause, or press F10 to execute a single step from a stopped state.
  2. Each press of F10 runs exactly one complete scan cycle: inputs are read, the program executes, and outputs are written.
  3. After each step, all variable values update in the watch panel and the 3D scene reflects the new output state.

Step debugging is invaluable for logic that changes state rapidly. Instead of trying to catch a brief signal in real-time, you can advance frame by frame and observe every transition.

Variable Watch Panel

The Watch panel displays live values for selected variables. To use it:

  • Click Add Watch and select variables from the program tree, or drag variables directly from the FBD/ST editor into the panel.
  • Variables are displayed with their current value, data type, and I/O direction.
  • BOOL values show a toggle indicator. Numeric values (INT, REAL, DINT) show their current number.
  • You can force a variable to a specific value by double-clicking its value field. Forced variables are highlighted in orange and retain their forced value until you release them.

Forcing inputs is useful for simulating sensor conditions that are difficult to reproduce in the 3D scene, such as fault states or extreme values.

Breakpoints

Breakpoints halt execution when the program reaches a specific point:

  • In Structured Text (ST), click the gutter next to a line number to set a breakpoint. The line is marked with a red dot.
  • In Function Block Diagram (FBD), right-click a block and select Set Breakpoint. Execution pauses before that block evaluates.
  • Conditional breakpoints let you specify an expression (e.g., counter > 100). Execution only pauses when the condition is true.

When a breakpoint is hit, the editor highlights the current execution point and the watch panel refreshes. Press F10 to step forward or F8 to continue running until the next breakpoint.

Diagnostics Panel

The Diagnostics panel provides system-level information about the running simulation:

MetricDescription
Cycle Time (actual)Measured duration of each scan cycle in milliseconds
Cycle Time (target)Configured target from project settings
Cycle OverrunsCount of cycles that exceeded the target time
I/O Bound VariablesNumber of variables connected to scene objects
I/O ErrorsCount of binding errors (e.g., deleted scene objects)
Memory UsageRuntime memory consumption of the PLC program

If actual cycle time consistently exceeds the target, your program may be too complex for the configured interval. Consider increasing the cycle time or optimizing your logic.

Common Debugging Workflows

Output Not Activating

  1. Add the output variable to the watch panel and confirm its value.
  2. If the value is correct in the watch but the scene does not react, check the I/O binding in the I/O Mapping panel.
  3. If the value is not changing, trace backward through the logic — add upstream variables to the watch and step through cycles.

Unexpected Timing

  1. Open the trace oscilloscope and add the relevant input and output signals.
  2. Run the simulation and observe the waveform timing.
  3. If the delay is longer than expected, check for unnecessary timer blocks or verify the scan cycle time is fast enough.

Intermittent Faults

  1. Set a conditional breakpoint on the variable that misbehaves (e.g., sensor_value < 0).
  2. Run the simulation at normal speed. When the condition occurs, execution pauses automatically.
  3. Inspect all related variables in the watch panel to identify the root cause.

On this page