LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

testing an instrument handle

Labview 8.0, TestStand 3.5,

Is it possible to test an instrument handle in Labview to see if it is valid and not generate any kind of error if it isnt?

I want to close an instrument handle if it exists. This will generate a run-time error if the handle does not exist.



0 Kudos
Message 1 of 6
(3,488 Views)
Hello tadk,
You can run VISA Find Resources and look at the resulting list of interfaces.  You can use this list to verify of an interface is valid.  If I specific error is being generated, you can create a sub-vi to clear that error, and thus ignore that particular error.
 
I am not sure what your end goal is, but there is another discussion forum that discusses getting a Session ID by using a Call Library Function Node.  You might want to check this forum out.
 
I hope this helps!
Regards,
Angela
Applications Engineer
0 Kudos
Message 2 of 6
(3,469 Views)

VISA find seems to only tell me what I already know. I know the string name of the instrument, which is also the name of handle which will be valid if the Initialize sub-VI for this instrument is successful in creating a session.

I was expecting I could test the handle similar to testing for a null pointers or file handles in other languages. If this is not possible the next best thing is to hide the run-time error dialog. How do I do this?

 

0 Kudos
Message 3 of 6
(3,460 Views)
Just to be clear on the things I have tried already:
 
Disabling the pop-up of Simple Error Handler
Leaving the error cluster disconnected
Feeding a 'no error' type constant into Simple Error Handler
Creating a custom vi with just my handle, the Call Library Function Node, and  "IVI Delete Session" sub-VI.
 
None of these will suppress the run-time error which is something like 'invalid session handle'.
0 Kudos
Message 4 of 6
(3,454 Views)
Do you have automatic error dialogs turned off? This is set in Tools>Options>Block Diagram.
0 Kudos
Message 5 of 6
(3,452 Views)

No I didn't. I see that this applies for all VIs and not just the problem one.

thanks

0 Kudos
Message 6 of 6
(3,448 Views)