LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

break on change in watch expression

Solved!
Go to solution

Hello,

 

is there a reason why one cannot set the check mark 'break on change' from the very beginning but only if the program is running (requiring an additional breakpoint)?

 

My scenario: I have added a watch expression for a variable by clicking on the variable in the source code window and subsequently Ctrl+F7. In the watch window, the variable name is shown, but in the field 'Break on Change' no checkmark is shown. Hence I need to add a breakpoint at the first line of main () just to set this checkmark...

0 Kudos
Message 1 of 7
(5,340 Views)
Solution
Accepted by topic author Wolfgang

Hello Wolfgang,

 

In 2013 the "Break On Change" behavour was changed.

You can read detalied information in Release Notes, section Watch Window.

Break on Change is available only for watchpoint that represent the contents of a memory adress(LHS expression). If you are not debugging the watchpoint can't be evaluated, the debugger doesn't know the memory adress of that expression.

 

Constantin.

Message 2 of 7
(5,307 Views)

I see, many thanks!

 

Would it be possible to add such a functionality to the debugger in the future, i.e. ask CVI to remember the users wish to watch a certain variable changing its value and then at run time define the memory location, or is it out of reach, i.e. too much effort?

0 Kudos
Message 3 of 7
(5,305 Views)

Hello Wolfgang,

 

"Break On Change" actually acts on a memory address and not on the watchpoint expression. The address is determined when you check "Break On Change" and from this point on the debugger breaks when the contents of that memory address was changed while the expression could reprezent another adress or could not be valid anymore(e.g if it contains a local variable that is out of scope).

 

Constantin

 

0 Kudos
Message 4 of 7
(5,301 Views)

Removing that nice feature sure is slowing my development down.  Tracking down an arcane bug right now, and I would love to see when a global variable is getting its value trashed.

 

Any other options left for us to do this?

 

EDIT

 

I read on this article about how to use the "Break On Change" feature and saw their screenshot didn't look like mine:

 

2016-02-05 09_23_02-Find Results.png

 

Oops, the un-confined windows fooled me!  Simply stretching mine out reveals...

 

2016-02-05 09_23_24-Find Results.png

 

hidden columns!

 

It's too bad not individual members of a structure can be triggered for breaking execution, but oh well.  At least I can continue debugging.

 

https://decibel.ni.com/content/docs/DOC-43950/version/5

0 Kudos
Message 5 of 7
(3,759 Views)

Hello ElectroLund,

 

You can still use break on change but while you are debugging the program. If you want to see when a global variable changes you can simply break on first statement(Run->Brak on->First statement) and put the checkmark when you are stopped. The difference from previous versions is that you can't put the check while you are not debugging because the memory address is not known.

 

Constantin

0 Kudos
Message 6 of 7
(3,753 Views)

Hello Electrolund,

 

If you want to monitor only a specific member of a struct you can add it as a watch expression and check Break on Change for that expression. To add a subitem as watch expression you can select it in the watch window/variables window and drag it in watch window.

0 Kudos
Message 7 of 7
(3,716 Views)