LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking for empty Visa Resource

Solved!
Go to solution

Dear all,

I am trying to check for an empty Visa resource. As up to 6 Visa Sessions will run simultaneously to control 6 Picoamperemeters, I’d like to give the User a precise error in case he/she forgets to define a Visa Resource for one of them.

I have tried to follow the instructions in this thread: https://forums.ni.com/t5/LabVIEW/check-for-empty-visa-resource/td-p/1480076

However, it does not seem to work. I am using Labview 2018.

Thank you for your help,

Paul  

0 Kudos
Message 1 of 9
(3,480 Views)

I'm not sure why you are building a structure with Error Lines embedded.  The question is does your code detect undefined VISA Resources, which could be something as simple as an Array of Booleans, True for PicoAmmeters that are both Enabled and have a valid VISA Resource Name, otherwise False, which you handle separately.  Can you detect invalid Resource Names?

 

Bob Schor

0 Kudos
Message 2 of 9
(3,452 Views)

Hi Bob,

I am trying to build an error message because otherwise the user gets always displayed a timeout error (which can, as I noticed, have a lot of different reasons in my set up).

My very crude way of detecting an invalid resource name is via a property node. Using the error coming from that node, I can actually do what I intended at the beginning. Are there more elegant ways to do so?

Best wishes,

Paul

0 Kudos
Message 3 of 9
(3,437 Views)
Solution
Accepted by topic author pawelpaul

Running LV 2017 here so I can't look at your code to see what you have done but detecting an empty VISA resource is as simple as this:

 

EmptyV.png

========================
=== Engineer Ambiguously ===
========================
Message 4 of 9
(3,431 Views)

Thank you, that works as well, and is more elegant than the property node.

0 Kudos
Message 5 of 9
(3,426 Views)

You didn't mention what model meters you were using, if these meters are 488.2 compliant and responds to IDN* queries with unique identifiers like that instruments serial number. 

 

I would suggest you write a routine that searches for the instruments and populates the VISA resources for your users automatically. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 9
(3,415 Views)

I am using RBD9103 Picoampèremeters, which are connected via USB and have a FTDI UBS Serial Converter in them. I do not know if they are 488.2 compliant, and as far as I could guess from the manual (https://www.rbdinstruments.com/products/files/downloads/9103//9103-picoammeter-user-guide.pdf, see last three pages), they do not have a serial number.

Your idea is very good, I just think it goes beyond the scope of my LabView capabilities and will be very difficult to integrate in a complex, existing Labview Program where this Picoampèremeters should function.

However, I can set a unique 10 character device identifier, which I will try to show to the user so he/she knows which COM port corresponds to which instrument. Thank you for that input.

0 Kudos
Message 7 of 9
(3,389 Views)

@pawelpaul wrote:

I am using RBD9103 Picoampèremeters, which are connected via USB and have a FTDI UBS Serial Converter in them. I do not know if they are 488.2 compliant, and as far as I could guess from the manual (https://www.rbdinstruments.com/products/files/downloads/9103//9103-picoammeter-user-guide.pdf, see last three pages), they do not have a serial number.

Your idea is very good, I just think it goes beyond the scope of my LabView capabilities and will be very difficult to integrate in a complex, existing Labview Program where this Picoampèremeters should function.

However, I can set a unique 10 character device identifier, which I will try to show to the user so he/she knows which COM port corresponds to which instrument. Thank you for that input.


You don't have to do that.  Not only can you set a unique 10-character device number for each instrument, it will automatically be returned with any input query:

"Double-click the device ID string in the “USB” section of the main window. Type a new 10 character
identifier and hit the enter key. The ID is displayed in both the main and data windows. Note that when
data is exported from multiple synchronized devices, the device ID appears in the header for the data
for each device".

 

I didn't look at the rest of the manual that thoroughly, but you could certainly do a Query at the beginning of your software, parse out the Device ID string in the main or data window, then proceed, knowing which device you are using.  You also should be able to get access to the Calibration settings of the Instrument (which may or may not be useful, depending on your application).

 

Bob Schor

0 Kudos
Message 8 of 9
(3,376 Views)

Dear Bob,

 

I have set an identifier and implemented this query as a sub VI. It might be a bit over-complicated as it is an adaption from another vi (a longer wait could probably replace the loop) but it works out well. Concerning calibration, it is more comfortable to access it via the Actuel software provided by RBD (although it should work out well with LabView).

 

Best wishes,

 

Paul

Download All
0 Kudos
Message 9 of 9
(3,355 Views)