LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug Report - Inactive Variable

I am running CVI 8.0 and have noticed a strange problem with some variables.  When I 'hover' over a variable (during debug run) sometimes nothing will happen, I proceed to right click and select 'view variable value' and I get an error stating "The variable VarName is not currently active."  The variable didn't show up in the list of variables that pulls up at the bottom of the CVI window.  The variable was obviously available to the program itself though (as we would expect), as I performed math with my variable and the proper value was loaded in to it.
 
All 3 times I have seen this error it gets corrected by marking the entire project for compilation and rerunning.
 
I don't know anything odd or specific about my setup or my project that would cause this type of issue.
0 Kudos
Message 1 of 4
(3,286 Views)
This is not something we are actively aware of. If you see the problem recurring and can determine some distinguishing characteristics of the disappearing variables, or can reduce your project to something simple that still behaves incorrectly, it would help us find out what's going wrong and fix it. I would make note of the variable's storage class and type. Also note if the variable never appears in the variable window, or if it disappears after some other thing happens. I would expect that the variable window would only be affected by the debugger's internal state and the running program stack. It would surprise me if a rebuild of the executable was necessary.

Mert A.
National Instruments
0 Kudos
Message 2 of 4
(3,274 Views)
Also: Keep in mind that variables declared inside a block delimited by { } (including a function definition) and not declared as static will only be active while that block is being executed. Once that section of code has been exited, the storage for the variable is destroyed.

Message Edited by cdk52 on 04-04-2008 07:41 AM
0 Kudos
Message 3 of 4
(3,273 Views)

Thanks for the quick response.  I'll certainly try to gather more information if possible in the future.  I have actually seen this occur 3 separate times now, so it would seem that something about my project is causing it.

The variable in question is actually global to my entire project and has a valid value at the time it is reported as not being active.  In the example code below the "inactive" variable is GlobalVariable (double) with a value of say 30, and NewValue is a local double.  If I set a breakpoint on line 120 and 'hover' over NewValue, I get the correct result of 80.  However, if I hover over GlobalVariable I get nothing and right-clicking to view variable value gives me the inactive variable error.  So the value of GlobalVariable is actually correct and available to the machine's program (since the math works out correctly), but not to the debugger for some reason.

100     NewValue = 50;

110     NewValue = NewValue + GlobalVariable;

120     sprintf(SomeString, "%f", NewValue);

0 Kudos
Message 4 of 4
(3,251 Views)