LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a constant for a null refnum somewhere?

Hello all,
I am trying to do a check of refnums that are passed into sub VI's.  What I would like to do is check to make sure the refnum is valid before any properties are used.  I can not seem to find any way to do this except for trying to get a property and catching the error.  I would hope there would be a better way to do this.  Any thoughts would be greatly appreciated.
Thanks,
Ben
0 Kudos
Message 1 of 7
(5,306 Views)
Look in File I/O->File Constants->Not a Refnum Constant
Message 2 of 7
(5,305 Views)
Ha ha ha, I must have looked there several times.  Thanks a bunch for the fast answer.
Ben
0 Kudos
Message 3 of 7
(5,302 Views)
Well, I jumped the gun a little on that.  When I wire up the code using the "Not a refnum" from the pallete->I/O I still get the error.  I did find that there is a check for refnum in the comparison pallete.  Just thought I would update.
Thanks,
Ben
0 Kudos
Message 4 of 7
(5,299 Views)

Hi Ben!

Were you able to get your application running using the "Not a Num/Path/Refnum?" function from the comparison palette you mentioned?  I played around with it and was able to get it to work with some example code.  It checked for refnums and displayed the correct boolean values.  If you still are having trouble, just let us know and we will be happy to help!  Best of luck with your application and have a great day!!

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(5,273 Views)
Hello Chris,
Yes, that comparison was exactly what I needed.  I had to check for valid refnums being passed into sub vi's and that worked.  Just a thought but putting a copy of that function into the Applications Control palete would be a good idea.  Since that is where all the property nodes are it would make sense.
Thanks for the post back,
Ben
0 Kudos
Message 6 of 7
(5,268 Views)

Hi again Ben,

I just wanted to let you know that I submitted a product suggestion to the product development team regarding your suggestion in the previos post.  We appreciate your comments and suggestions!  If you ever have any others, feel free to submit them at www.ni.com by selecting "Contact NI" and then "feedback" from the "Product Feedback" section.  Have a great day!

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(5,254 Views)