01-26-2010 06:19 PM
I am looking for some clarification for the Control Value:Get Method for the flattened and variant cases.
Documentation is as follows:
The first time you call this method on a VI whose front panel is not open, this method returns the default values of the control or indicator rather than the actual values. Thereafter, it returns the actual value.
My question is: If the front panel is NOT opened and I read a certain indicator 2 times, will I get the actual value instead of the default value? (the first time would be a dummy read so the second one would access the actual). If the double-read idea works, does it need to be performed on every indicator that is accessed, or does it only need to be done one time to update ALL of the front panel values to actuals?
Example:
I am trying to read indicators X and Y from a closed front pane.
I read X once -- I get the default value. I read X a second time, and I get the real value?
Do I need to repeat the double read for Y in order to get the actual value?
Thanks
-Ted
01-26-2010 08:18 PM
01-26-2010 09:16 PM
01-27-2010 09:37 AM
01-27-2010 09:51 AM
My unsubstantiated guess is that the first time you call this function to read an indicator in a subVI whose Front Panel isn't open, the Front Panel will be loaded (in some hidden state). At this point, it's still too late to get an actual indicator value, however, so a default value is returned. The second time you call the function, the Front Panel is open, so the function should succeed, even if you're calling it for a different indicator.
01-27-2010 10:25 AM
01-27-2010 11:18 AM
Jarrod S. wrote:My unsubstantiated guess is that the first time you call this function to read an indicator in a subVI whose Front Panel isn't open, the Front Panel will be loaded (in some hidden state). At this point, it's still too late to get an actual indicator value, however, so a default value is returned. The second time you call the function, the Front Panel is open, so the function should succeed, even if you're calling it for a different indicator.
That's precisely what I did in the example I had posted. The subVI has the indicator set to have Inf as the default value. A control with a default value of 23 is wired directly to the indicator. I open a reference to the subVI (that is not open). I read the indicator value twice, then run the VI and read the indicator again. The first and second reads both say Inf. The third read (expectedly) says 23. Now, the question is: what default value is the Help talking about? The default value for the datatype, or the default value that's set for the indicator?