Skip to main content

Dialog: New Breakpoint

Function: In the dialog, you define the settings for a new breakpoint or data breakpoint. It is identical to the Breakpoint Properties dialog which is used in the Breakpoints view.

Call:

  • Command: Debug → New Breakpoint

  • Command: New Breakpoint

Requirement: The application is in online mode.

Tab: Condition

The dialog defines the requirements under which the program processing should halt at a breakpoint.

Important

Using conditional breakpoints slows down the code execution, even when the condition does not yield TRUE.

Tip

Conditional breakpoints require a CODESYS runtime system >= V3.5.4.0.

Table 129. Tasks

Break only when the breakpoint is hit in one of the following tasks

_cds_icon_checked.png: CODESYS evaluates the breakpoint only when it is reached by specific tasks. The required tasks have to be activated.

For example, you can define a single "debug task" and as a result prevent other tasks, which also use the same POU, from being affected when debugging.



Table 130. Hit Count

Hit Count

Break always: The program always halts at this breakpoint.

Alternative: The program halts at the breakpoint when the breakpoint has been reached as often as defined in the following (type in the required hit count or select it from the number list):

  • Break when the hit count is equal to

  • Break when the hit count is a multiple of

  • Break when the hit count is greater than or equal to



Table 131. Condition

Break, when true

_cds_icon_checked.png: CODESYS evaluates the specified condition and halts the program at the breakpoint only when the result yields TRUE. You can define a condition as a valid Boolean expression.

Examples: x>100, x[y]=z, a AND b, boolVar



Tab: Data

Requirement: This is used for the properties of a "data breakpoint".

Tip

The function of the data breakpoints depends on the target system. Currently, data breakpoints are possible only with the CODESYS Control Win.

On the tab, the variable or memory address is specified for which the data breakpoint is set or will be set.

Break execution when the value of the variable or address changes

  • Input of a qualified variable name

  • _cds_icon_input_assistent.png: Selection of a variable in the Input Assistant dialog, in the Watch Variables category

Examples

Variable: PLC_PRG.fb_DoSth.dwVariable

Address: 16#12A, 0x12A, 129

Size

Number of bytes of the specified variable or memory address above which should be monitored for changes

When a new variable or memory address is specified, a value which matches the data type or memory is automatically set first of all.

Note: The Size and count depend on the target system. For the CODESYS Control Win, a maximum of 4 data breakpoints with a maximum size of 8 bytes can be defined.

Example: 4 for data type DWORD

Example: 2 for data type DWORD: Only the first 2 bytes of the variable are monitored.

Tab: Execution Point Settings

Here, an existing breakpoint or data breakpoint can be converted into an execution point.

Execution point (execution does not stop at breakpoint)

standard icon: The breakpoint becomes an execution point. Processing does not halt at this point and the given code is executed.

  • Execution point of a breakpoint: _cds_icon_executionpoint_activated.png enabled, _cds_icon_executionpoint_deactivated.png disabled

  • Execution point of a data breakpoint: _cds_icon_data_execution_point_enabled.png enabled, _cds_icon_data_execution_point_disabled.png disabled

Execute the following code

Code which is executed when the execution point is reached

Looping structures (For, While) and IF or CASE expressions are not possible.

Print a message in the device log

This option is available only when you select the Enable logging in breakpoints option in Project Settings → Compile options.

CODESYS can output variables with the {variable name} placeholder in the message text.

Tab: Location

Requirement: The New Breakpoint command has been was executed.

POU

POU of the active application where the breakpoint is positioned

Position

Position of the breakpoint in the POU

Entry as row and column numbers (text editor) or as network or element numbers

Instances

In the case of function blocks, you have to define whether the breakpoint should be set in the implementation or in an instance.

standard icon CODESYS sets the breakpoint in the instance. For this option, select Instance Path.

_cds_icon_option_deactivated.png CODESYS sets the breakpoint in the implementation.

Enable breakpoint immediately

standard icon: The breakpoint is enabled.

_cds_icon_option_deactivated.png: The breakpoint is disabled. To enable it later, click the _cds_icon_breakpoint_activated_deactivate.png button in the Breakpoints view.

For more information, see: Using Breakpoints