Method Debugger

You can debug the source code you wrote in the Debugger window. To open the Method Debugger:

Note:

When Plant Simulation is running in the foreground, hold down the Ctrl+Alt+the left Shift keys for several seconds to open the Debugger while a Method is being executed.

When Plant Simulation is not running in the foreground, hold down the Ctrl+Alt+the right Shift keys for several seconds to open the Debugger while a Method is being executed.

Note:

Plant Simulation opens the Debugger automatically when it encounters an error while executing the source code or when it hits a breakpoint.

The Debugger window shows the parameters and local variables of the Method. You can set breakpoints at critical points and then check each step of the Method execution to see if the source code does what you programmed it to do:

  • Press the F9 key, click , use the context menu or click the right mouse button while holding the Shift key down to insert a Class Breakpoint, designated by a filled red circle to the left of the line.

  • Press Shift+F9, use the context menu or click the right mouse button while holding the Shift + Ctrl keys down to insert an Instance Breakpoint, designated by a red star to the left of the line.

The Debugger shows the values of attributes and local variables as a tooltip, when you drag the mouse over the instruction.

Double-click a word to select it. Triple-click in a line to select the entire line. Quadruple-click to select the entire source code.

The Method highlights lines with erroneous source code in red in the Method Debugger. It shows an message telling you what’s wrong in the status bar of the Method Debugger window.

To restart executing the source code that follows after break point or an error, hold down the Ctrl key and double-click that line.

When the Method Debugger was opened because of a runtime error and when you then close the Method Debugger, Plant Simulation terminates all call chains without asking and stops the simulation.

If you only want to terminate the incorrect call chain and continue the simulation, press the F5 key instead of closing the Method Debugger.

If you do not want to terminate the incorrect call chain, you can continue the incorrect Method in a certain line of code by calling the context menu command Set Next Statement, or by placing the input cursor into this line and by pressing Ctrl+F10, or by holding down the Ctrl key and double-clicking this line. Then press the F5 key to continue executing the Method in this line.

The lower part of the Debugger window shows a Watch Window. This feature is especially handy, if you want to show the contents of two tabs of the watch window at the same time. Then, you can click and open a second watch window and click another tab there. You can change its height by dragging the splitter.

Related Topics

Toolbar of the Method Debugger

Menu Bar of the Method Debugger

Context Menu of the Method Debugger

Functions for Debugging the Model