08-13-2010 03:54 AM
Hi all,
I am working on a LV7.1 program. It has a refnum control on front panel. If this control is not connected by caller, the followed "Not a number/path/refnum" will return TRUE. It is like a "default value". But i don't know how to implement this function. I mean, i can't find a way to set refnum control with a default value as "Not a number/path/refnum". Anybody can give me a hint?
thanks,
steady
Solved! Go to Solution.
08-13-2010 04:00 AM
What do you want to get with this?
The 'Not a Refnum' node checks whether the data in the reference points to a valid control, you can use it as a check before you start setting properties (which will return errors when the refnum is invalid) so your code is more robust.
You can connect this control from an owning VI so it has a valid reference.
To
08-13-2010 04:09 AM
Under File I/O -> File Constants there's a "Not a Refnum" constant. (Why under File I/O? Dunno?)
You can change your control to an indicator, wire it up to this, run the VI once and then change things back (you now have the value of Not a Refnum). You can then make the value stick by right-clicking on the control and choosing Data Operations -> Make current value default.
This is assuming that the control has managed to be pre-initialised with a value other than not a refnum.
08-13-2010 04:12 AM
TCPlomp,
Do you know how to get it? I want to know it for dual reasons:
1, i am curious why a refnum control is not a refnum when not connected;
2, in program it uses the boolen from "Not a Refnum" to determine if it is passed a new refnum or not. I think it is a useful function.
Steady
08-13-2010 04:16 AM
The function checks wheter the reference is a valid reference. When nothing is connected it will return a NULL-reference which is invalid.
When the value is non-NULL it will try to check wheter the reference is still valid.
I don't understand what you mean by point 2.
Ton
08-13-2010 04:24 AM
Intaris,
Thanks. I tried and you are absolutely correct.
Steady