New Breakpoint... / New Data Breakpoint...
The Debug > New Breakpoint... / Debug > New Data Breakpoint... commands are available in offline and in online mode, in the debug context as well as in the breakpoints view.
The New Breakpoint / New Data Breakpoint dialog box opens. It allows you to define the position and the conditions for a new breakpoint or a new data breakpoint in the active application. In online mode, you can additionally define execution points.
In order to use data breakpoints, the device description file must include target entries that correspond to your controller.
Also refer to the corresponding functions in the Breakpoints dialog box.
For setting a breakpoint at the cursor position, refer to the Toggle Breakpoint command.
Location Tab of the New Breakpoint Dialog Box
Element |
Description |
---|---|
POU: |
The selection list offers the POUs available in the active application. Select the one where you want to set a breakpoint. |
Position: |
The selection list offers the possible breakpoint positions of the selected POU. Depending on the editor type, these positions are defined by line and column numbers (text editors) or as network or element numbers (graphic editors). In case of a function block, (Impl)) is added additionally. You have to decide whether the breakpoint should be set in the implementation or in an instance. If it requires setting during the implementation, leave the option Instance Path disabled. If it should be set in an instance, enable the option Instance Path to select the instance. |
Instances: |
If the selected POU is a function block and this option is disabled, the breakpoint is set in the implementation body of the POU (refer to the Position element). If you want to set the breakpoint in an instance, enable the option and select the instance. |
Condition Tab of the New Breakpoint Dialog Box
The Condition tab allows you to define conditions that cause the program execution to stop at the breakpoint:
Element |
Description |
---|---|
Tasks: |
|
Only break if breakpoint is hit in one of the following tasks: |
Enable this option if the breakpoint only should be effective in case the POU where it is placed is processed by certain tasks. This allows you to set a specific task to stop at the breakpoint within the POU and not in other tasks, which also use the same POU. Refer to Breakpoints and stepping in applications with multiple tasks. The tasks defined in the project will be listed for selection. |
Hit Count: |
|
Break always: |
The program will stop at the breakpoint. |
Alternatively: |
The program will not stop at the breakpoint until the breakpoint has been reached the number of times defined (Enter the desired number or select it in the number field): oBreak when the hit count is equal to oBreak when the hit count is a multiple of oBreak when the hit count is greater than or equal to |
Condition |
|
Break, if TRUE |
If supported by the runtime system, you can use conditional breakpoints. Consult the Programming Guide specific to your controller to see if it supports conditional breakpoints. The condition can only be specified in online mode. The specified condition is evaluated. Only if the result is TRUE, the program will stop at this breakpoint, the code of the execution point will be executed. You can enter valid boolean expressions as condition. Example: x>100, x[y]=z, a AND b, boolVar NOTE: Using conditional breakpoints slow down the code execution even if the condition is not TRUE. |
Data Tab of the New Data Breakpoint Dialog Box
The Data tab allows you to modify the variable for which a data breakpoint is set:
Element |
Description |
---|---|
Break execution when the value of the specified variable changes: |
oEnter a valid variable name. oSelect a variable from the Input assistant dialog box (category Watch variables). |
Execution point settings Tab of the New Breakpoint Dialog Box
Element |
Description |
---|---|
Execution point (Execution does not stop at breakpoint) |
The breakpoint becomes an execution point. This means that the processing is not stopped at this point, but the given code is executed. Execution point enabled: Execution point disabled: Execution point of a data breakpoint enabled: Execution point of a data breakpoint disabled: |
Execute the following code |
Enter the code to be executed. The following restrictions apply: oCode size < 1200 bytes oNo conditional statements, loop constructions (IF, CASE, FOR, WHILE) oNo function block calls oNo method calls oNo bit-operations with AND, OR, NOT operators oNo multiplication and division with other data types than INT oNo calling properties in instances of an interface type Additionally, this restriction applies: The called functions and properties must match at least one of two following conditions: 1. In the View > Properties > Build dialog box, the option Enable system calls is activated. 2. The following attribute is added above the declaration of the function/the property: {attribute 'monitoring' := 'call'}. |
Print a message in the device log |
This option is available if the option Enable logging in breakpoints is activated in the Project Settings > Compile options dialog box. If the message should contain the present value of a variable, insert the variable name enclosed in curly brackets. Example: The present value of variable iCount is: {iCount}. |
Enable breakpoint immediately |
Select the Enable breakpoint immediately option to activate the breakpoint. Deselect the Enable breakpoint immediately option to deactivate the breakpoint. To activate the breakpoint later, click the |