IEC 61131-3 Debugger

Help Contents


The IEC 61131-3 Debugger allows you to step through and test IEC 61131-3 code:

Fernhill SCADA IEC 61131-3 Debugger

The debugger window contains four sections. From top to bottom, the four sections are:

Debug Toolbar Controls how the debugger steps through the code.
Module List Displays the names of the source code files relevant to a debug session. Allows you to switch between source code files.
Source Window Displays the current source code file and current execution location. Allows you to set and clear breakpoints in the code.
Variable Window Displays the variables in scope at the current location. Allows you to change variable values.

Starting a Debug Session

You can start an IEC 61131-3 debug sessions from:

Debug Toolbar

The debug toolbar provides you with commands to step through IEC 61131-3 code:

Command Description
Debug Break Icon Stops execution immediately.
Restart execution Restarts execution from the start of the program or script.
Continue execution Continue execution until one of the following occurs:
  • The Break Debug Break Icon button is pressed.
  • A breakpoint is reached.
  • The program or script completes.
Debug show source location Displays the current source location.
Debug step into Steps into a function call.
Debug step over Steps over the current line.
Debug step out of Returns from the current function.

Module List

The Module List provides the list of source code modules referenced by the current script. To display the source code for a module: select the module from the list. To return to the current source location: click the Display Source Location Debug show source location button in the toolbar.

Source Window

The Source Window displays the code you are currently running through the debugger:

Debug source window

From left to right, the Source Window has three areas:

The Debug Marker Area displays debug markers in your code:

Current source location marker Shows the current execution location.
Break point marker Shows the location of a breakpoint.

To set or clear a breakpoint click on the Debug Marker Area. Note: The debugger will only allow you to set breakpoints on source code lines that correspond to actual code. For example you cannot set a breakpoint on lines that contain only whitespace or comments.

Variable Window

The Variable Window shows the program variables that are in scope for the current source code location:

IEC 61131-3 debugger variable window

To change a value do one of the following:

Further Information

Common Elements

To learn about IEC 61131-3 Common Elements you can use in Structured Text (ST) programs and functions.


For the meaning of terms used in Fernhill SCADA.