LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A refnum control is not a number/path/refnum

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(4,043 Views)

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

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 6
(4,040 Views)
Solution
Accepted by topic author steady

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.

Message 3 of 6
(4,031 Views)

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

0 Kudos
Message 4 of 6
(4,030 Views)

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

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 6
(4,022 Views)

Intaris,

 

Thanks. I tried and you are absolutely correct.

 

Steady

0 Kudos
Message 6 of 6
(4,016 Views)