Command New Breakpoint
Symbol:
Function: The command opens the Breakpoint Properties dialog.
Call: Debug menu, button New in the Breakpoint view (PLC > Window > Breakpoints).
Requirement: The PLC project is in online mode.
The command Toggle Breakpoint can be used to set a new breakpoint directly at the current cursor position in online mode. |
See also:
- Command Toggle Breakpoint
- PLC menu: Command Breakpoints
- PLC documentation: Use of breakpoints
Breakpoint Properties dialog
Enable breakpoint immediately | The breakpoint is activated. The breakpoint is not activated. To activate later, click the button in the view Breakpoints. |
Condition tab
The dialog defines the conditions under which the program execution should stop at the breakpoint.
Tasks
Only break if the breakpoint is hit in one of the following tasks | :TwinCAT only evaluates the breakpoint if it is reached by certain tasks. The required tasks must be activated. For example, you can define a single "debug task" and thus prevent other tasks that also use the function block from being affected during debugging. |
Hit Count
Hit Count | Break always: The program always stops at this breakpoint. Alternative: The program stops at the breakpoint when the breakpoint is hit as often as defined below (enter the desired number of hits or select from the number list):
|
Condition
Break, if TRUE | Definition of conditional breakpoints. The condition can only be entered in online mode. : TwinCAT evaluates the specified condition and stops the program at this breakpoint if the result is TRUE. Valid Boolean expressions can be entered as a condition. Examples: x>100, x[y]=z, a AND b, boolVar. |
The use of conditional breakpoints slows the code execution, even if the condition is not TRUE. |
Location tab
POU | Function block of the active PLC project in which the breakpoint is to be positioned. |
Position | Position of the breakpoint in the POU. Specification in the form of line and column numbers (text editor) or as network or item numbers. |
Instances | For function blocks, you must specify whether the breakpoint should be set in the implementation or in an instance TwinCAT sets the breakpoint in the instance. With this option, you select the instance path. TwinCAT sets the breakpoint in the implementation. |
Execution point settings tab
Here an existing breakpoint can be converted into an execution point.
Execution point (Execution does not stop at breakpoint) | : The breakpoint becomes the execution point. The execution does not stop at this point, but the specified code is executed. enabled: , disabled: |
Execute the following code | Code that is executed when the execution point is reached. Loop constructs (For, While) and IF or CASE expressions are not possible. |
Print a message in the device log | This option is not available. |
See also:
- PLC documentation: Use of breakpoints