Step-By-Step Debugging
In addition to the cycle-by-cycle execution mode, the debugger has a collection of features for Step-By-Step Debugging in the source code of the application.
-
-
Step-By-Step Debugging is only available if the project has been compiled with the Debug option.
This option is selected from the project compiling PLC "Programmable Logic Controller" A Programmable Logic Controller, PLC, or Programmable Controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events options dialog box (accessed using the button).
Figure 4-53: PLC Options - Debug Compiling Mode
- An application compiled in Debug mode includes additional information for stepping.
- This leads to a larger code size and reduced performance.
- When debugging is finished, it is recommended to compile the application in Release mode to give highest performance to the application.
Step-By-Step Debugging is available in:
- FBD "Function Block Diagram" A function block diagram describes a function between input variables and output variables. A function is described as a set of elementary blocks (a step is considered as a graphic symbol corresponding to an action).
- FFLD "Free Form Ladder Diagram" programs (a step is considered as a rung).
- ST "Structured text" A high-level language that is block structured and syntactically resembles Pascal and IL "Instruction List" This is a low-level language and resembles assembly text programs (a step is considered as a statement).
-
-
Step-By-Step Debugging is not possible in SFC "Sequential Function Chart" It can be used to program processes that can be split into steps. The main components of SFC are: - Steps with associated actions - Transitions with associated logic conditions - Directed links between steps and transitions programs.
See About SFC for more information.
These are the options for entering the Step-By-Step Debugging mode:
- When a breakpoint is set in a program.
- See Breakpoints for more information.
- See Breakpoints for more information.
- When you start your application and the breakpoint is reached, the execution stops at the specified location.
You can run one step further in the program with the stepping commands. - When the target is in cycle stepping mode (STOP).
- You can step to the beginning of the first program.
-
-
Pausing a program does not interrupt the current VM cycle.
The current cycle finishes and execution is paused before the beginning of the next VM cycle.
These commands are available from the Debug toolbar for stepping:
Button | Description |
---|---|
|
Step Over the next instruction: If the next instruction is a call of a function block or a sub-program, the execution passes over to the following instruction. |
|
Step Into the next instruction:
|
|
Step Out the current block:
|
These commands are available at any time:
Button | Description |
---|---|
|
Execute a cycle step (from the current position up to the end of the last program). |
|
Restart the target in Normal execution mode (RUN). |