Setting, Removing, Enabling, and Disabling Breakpoints
This section discusses working with breakpoints within the editor. See Breakpoints tab for information on the Breakpoints tab in the Information and Logs widget, including modifying breakpoints in bulk. For background information see About Breakpoints.
How to Set Breakpoints
- Open your program in the IEC"International Electrotechnical Commission" IEC is a not-for-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies 61131-3 Editor.
- Click on the line (for ST"Structured text" A high-level language that is block structured and syntactically resembles Pascal/ IL"Instruction list" This is a low-level language and resembles assembly) or diagram (for 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 1 , 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 or FFLD) where you want to set the breakpoint.
- Press F9 or right-click and select Add/Remove Breakpoint from the menu.
- A Breakpoint circle is added to or remved from the left margin. The Breakpoint will be set as either active () or inactive (), based on the IDE"Integrated development environment" An integrated development environment is a type of computer software that assists computer programmers in developing software. IDEs normally consist of a source code editor, a compiler and/or interpreter, build-automation tools, and a debugger's connectivity (see About Breakpoints).
Figure 5-59: Setting Breakpoints
Even when you are not connected to the Controller, breakpoints can be placed in programs, sub-programs or UDFBs.
-
-
When you start your application, if the current position is not on a valid line for stepping, the breakpoint is automatically moved to the nearest valid position.
-
-
When you close the connection with the target, all the breakpoints are removed in the KAS RuntimeIn computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). Within KAS, runtime also refers to the virtual machine that manage the program written in a computer language while it is running.
About SFC
There are several things to note about breakpoints in SFC programs:
- In SFC programs, breakpoints can only be set on transitions (i.e. in First Level diagram), and not in steps or conditions. With a breakpoint set on a transition, you can debug cycle-by-cycle. Please remember that P1, N and P0 placeholders are designed to contain very simple code.
The recommended way to proceed for SFC sub-level programs is to rely on subprograms, where debugging is allowed.
- Breakpoints can be set and removed in SFC programs, they cannot be enabled and disabled.
How to Enable/Disable a Breakpoint
To enable a breakpoint, right click on an inactive breakpoint and select Enable / Disable Breakpoint (or Ctrl + F9). This is only available when the IDE and runtimeIn computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). Within KAS, runtime also refers to the virtual machine that manage the program written in a computer language while it is running are connected.
To disable a breakpoint, right click on an active breakpoint and select Enable / Disable Breakpoint (or Ctrl + F9). Selecting this option will remove the breakpoint from the runtime; the breakpoint will be remain in the editor and be changed to an inactive state ().