07-03-2013 01:02 PM
I'm trying to modify a program to enable/disable certain parts depending on whether or not the instrument it controls is connected via GPIB. There is limited functionality of the program that I still want to use even if the instrument isn't actually connected and turned on. Is there a way to check the GPIB connection programmatically that won't throw out all kinds of run time errors if it isn't connected?
07-03-2013 01:11 PM
07-03-2013 01:21 PM
You can use the Visa Find Resource Function to get a list of GPIB actively connected to the computer. Then you can send an *IDN? query to each and match it against a list of known instruments to check if the required instrument is connected and communicating.
07-03-2013 01:22 PM
I used something like this(see attached ) to check my lock-in communication which uses GPIB connection.
@Stephen.E wrote:
I'm trying to modify a program to enable/disable certain parts depending on whether or not the instrument it controls is connected via GPIB. There is limited functionality of the program that I still want to use even if the instrument isn't actually connected and turned on. Is there a way to check the GPIB connection programmatically that won't throw out all kinds of run time errors if it isn't connected?
07-03-2013 01:29 PM
@Tavar wrote:
You can use the Visa Find Resource Function to get a list of GPIB actively connected to the computer. Then you can send an *IDN? query to each and match it against a list of known instruments to check if the required instrument is connected and communicating.
Thanks, I'll give this a shot.
@AnkitG wrote:
I used something like this(see attached ) to check my lock-in communication which uses GPIB connection.
I'm not familiar by sight with all of the commands you used. Would you mind uploading the .vi file? Thanks.
07-03-2013 02:01 PM
@Stephen.E wrote:
@Tavar wrote:
You can use the Visa Find Resource Function to get a list of GPIB actively connected to the computer. Then you can send an *IDN? query to each and match it against a list of known instruments to check if the required instrument is connected and communicating.
Thanks, I'll give this a shot.
@AnkitG wrote:
I used something like this(see attached ) to check my lock-in communication which uses GPIB connection.
I'm not familiar by sight with all of the commands you used. Would you mind uploading the .vi file? Thanks.
Those are just visa write , read function and then I am converting decimal to numbers and numbers to boolean to check the status.
07-03-2013 02:05 PM
07-03-2013 02:16 PM
07-03-2013 04:24 PM
@Dennis_Knutson wrote:
Can't edit my post.
You'll actually get an error on a write because of the lack of handshaking.
I'm not entirely sure if I understand what you are saying or not. Let me talk my way through it and see if it sounds correct. Are you saying that I could use a visa write, then just unbundle the status bolean from the error and that will essentially tell me if the instrument is connected or not? Failing the visa write wont cause any runtime error messages to pop up?
07-03-2013 05:01 PM
@Stephen.E wrote:
@Dennis_Knutson wrote:
Can't edit my post.
You'll actually get an error on a write because of the lack of handshaking.I'm not entirely sure if I understand what you are saying or not. Let me talk my way through it and see if it sounds correct. Are you saying that I could use a visa write, then just unbundle the status bolean from the error and that will essentially tell me if the instrument is connected or not? Failing the visa write wont cause any runtime error messages to pop up?
If you handle the error and clear it, there won't be a pop up. But your are correct. If there is an error from the VISA write, your instrument is not there. You can just unbundle the status boolean.