Dialog ‘New breakpoint’

Function: In the dialog, you define the settings for a new breakpoint or data breakpoint.

Call:

  • Menu bar: Debug ‣ New breakpoint
  • Menu bar: Debug ‣ New data breakpoint
  • Drop-down list: b37f8599ca5eabebc0a864630cdc6bd3_7c104bfb1c7703d1c0a8640e01c95c51 New in the Breakpoints view

Requirement:

  • The application is in online mode.
  • In order to use data breakpoints, the device description file must include target entries that correspond to your controller.
Tab Condition
Tasks
Only break if the breakpoint is hit in one of the following tasks:

b37f8599ca5eabebc0a864630cdc6bd3_9a3f06830c0506c5c0a8640e012f0ace : CODESYS passes the breakpoint only if it is reached by specific tasks. The required tasks must be activated.

For example, you can define a single debug task and also prevent other tasks b37f8599ca5eabebc0a864630cdc6bd3_df726ece31d5c46bc0a8640e01307aa0 that use the same POU or variables from being affected when debugging.

Hit Count
Break always Break always: The program always halts at this breakpoint.
Break when the hit count is equal to The program halts at the breakpoint if the breakpoint has been reached as often as you have selected or specified here.
Break when the hit count is a multiple of
Break when the hit count is greater than or equal to
Condition
Break, if true b37f8599ca5eabebc0a864630cdc6bd3_9a3f06830c0506c5c0a8640e012f0ace : CODESYS passes the given 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: The command New data breakpoint was selected.
Interrupt execution if the value of the specified variable changes:

Variable for which the data breakpoint is set

  • Input of the qualified variable name
  • b37f8599ca5eabebc0a864630cdc6bd3_21d51bd0cd4519c1c0a8640e00abb4b7 : Selection of the variable in the Input assistant dialog (category: Watch variables)
Tab Location
Requirement: The command New breakpoint was selected.
Location
  • POU: POU of the active application where the new 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 must define whether the breakpoint should be set in the implementation or in an instance.

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

b37f8599ca5eabebc0a864630cdc6bd3_4681610f0c058035c0a8640e0049916a CODESYS sets the breakpoint in the implementation.

Tab Execution point
Execution point (execution does not stop at breakpoint)

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

  • Execution point of a breakpoint: activated: b37f8599ca5eabebc0a864630cdc6bd3_973f893e1c48ff2bc0a8640e00c95eda ; deactivated: b37f8599ca5eabebc0a864630cdc6bd3_71f71bf61c4dc012c0a8640e01b5f4d5
  • Execution point of a data breakpoint: activated: b37f8599ca5eabebc0a864630cdc6bd3_3cde2c2dcb404c29c0a864631ccb517b ; deactivated: b37f8599ca5eabebc0a864630cdc6bd3_8fe1ad38cb3d51e1c0a86463428457fa
Execute the following code

Code that 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 check box in Project Settings ‣ Compiler options.

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

Enable breakpoint immediately

b37f8599ca5eabebc0a864630cdc6bd3_9a3f06830c0506c5c0a8640e012f0ace : The breakpoint is activated.

b37f8599ca5eabebc0a864630cdc6bd3_4681610f0c058035c0a8640e0049916a : The breakpoint is not activated. To activate later, click the b37f8599ca5eabebc0a864630cdc6bd3_df726ece31d5c46bc0a8640e01307aa0 button in the Breakpoints view.

See also