The function of the data breakpoints depends on the target system. Currently, data breakpoints are possible only with the CODESYS Control Win V3.
Program execution stops at a data breakpoint when the value of a particular variable or memory address changes. As with "normal" breakpoints, the halt can be linked to an additional condition, or specific code can be processed instead of the halt (converted to a data execution point).
You set a data breakpoint either by means of the “New Data Breakpoint” command in the “Debug” menu or by means of the “New” button in the “Breakpoints” view. You specify a qualified variable name or a memory address directly which is to be monitored for changes in its value.
Example
In the following sample code, the memory of the variable iNumber
is overwritten unintentionally. However, a data breakpoint at the variable iNumber
will detect when its value changes. The processing then stops with a corresponding
message at the array access, which overwrites the variable value: Idx
= 7
.
See also below: "Setting a data breakpoint"
PROGRAM PLC_PRG VAR Idx : INT; Ary : ARRAY[0..3] OF BYTE; iNumber : INT := 55; END_VAR FOR idx := 0 TO 6 DO Ary[idx] := 0; END_FOR