LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get visa resource name drop down list values

Solved!
Go to solution

Hey,

 

Is there any way to get the all the addresses from a Visa Resource Name control ? For example, the Visa Resource Name automatically identify from ni Max 3 GPIB addresses and i want to create an array with all these 3 addresses. 

 

You would probably say to use Visa Find Resources, but i already tried that and i don't know for what reason it doesn't identify the GPIB instruments.

It works on labview 2014 under windows 10, but on labview 2014 under windows 7 it doesn't. I think it's something about the VISA driver.

 

Anyway, the main question is if can i access and get (maybe in an array) somehow the dropdown list of a Visa Resource Name control.

 

Regards,

Daniel  

0 Kudos
Message 1 of 14
(4,053 Views)

@Bugsy26 wrote:

Hey,

 

Is there any way to get the all the addresses from a Visa Resource Name control ? For example, the Visa Resource Name automatically identify from ni Max 3 GPIB addresses and i want to create an array with all these 3 addresses. 

 

You would probably say to use Visa Find Resources, but i already tried that and i don't know for what reason it doesn't identify the GPIB instruments.

It works on labview 2014 under windows 10, but on labview 2014 under windows 7 it doesn't. I think it's something about the VISA driver.

 

Anyway, the main question is if can i access and get (maybe in an array) somehow the dropdown list of a Visa Resource Name control.

 

Regards,

Daniel  


You would need to use Find VISA Resources along with an Identity command; typically this command is "*IDN?". The Find Resources identifies all the VISA addresses, and an Identity command gives you the instrument model.

 

(Note, not all instruments use *IDN?, see this.)

 

mcduff

0 Kudos
Message 2 of 14
(3,994 Views)

Hi mcduff,

 

Thanks for your response. But this is not my case. I dont' want to identify them.

I want to SCAN (basically replicate the what Scan For Instruments does in NI Max) all the connected instrument (whether it is via GPIB, USB, COM or PXI).

In order to do that, one way is to use VISA Find Resource Function ( connect the proper expression as input etc). But i don't know for what reason, the array generated by this function doesn't include any GPIB connected instrument.

 

On 1 PC (Windows 10, Labview 2014, NI-VISA 18.5), it works, it finds the GPIB's, but on another system (Windows 7, Labview 2014, NI-VISA 14), it doesn't. I suspect the VISA driver is the reason why.

 

Stil, this wasn't my question. I'll try to elaborate :

 

When you add a Visa Resource Name Control, it automatically fills with all the VISA connected instruments. When i refresh this control, it finds my GPIB instruments, but using the VISA Find Resource Function, it won't. What is the difference ? Why does one way works and the other not, on the same system ? 

 

And also, is there a way to get the dropdown list (the list of identified addresses) from Visa Resource Name Control using property nodes or to more generic/specific functions? Any ideas ? From what i've seen, VISA Resource Name is neither Enumerator, nor Ring, neither Combobox nor List ... for this type you can get the items via property node, but for Visa Resource Name you don't have such kind of property.

 

Hope i made myself clear now !

 

I've tried to use NI I\O Trace to see what functions are called when playing with Visa Resource Name Control and now i'm trying to identify the libraries that are called ... maybe i'll succed this way ... i don't know ... work in progress ... 😄

 

Daniel

0 Kudos
Message 3 of 14
(3,979 Views)
Solution
Accepted by topic author Bugsy26

There's a private property that returns the list.

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 14
(3,953 Views)

Hi Paul,

 

Thanks. This is great. But how do i get to access that property ? 😄

 

0 Kudos
Message 5 of 14
(3,940 Views)
Solution
Accepted by topic author Bugsy26

Look at this link, also you can just copy and paste what Paul attached.

 

mcduff

Message 6 of 14
(3,918 Views)

The question is why Visa Find Resources did not return any GPIB resources. I'ts been a while since I used it but the help for the function doesn't say much more. It should just work, as long as you don't apply a filter to it.

 

Using unsupported functions shouldn't be needed.

 

Certified LabVIEW Architect
0 Kudos
Message 7 of 14
(3,910 Views)

Hi thols,

 

The fact is i apply filters (as you can see in the attached picture).

I apply many other filters because for example i don't want the instrument array to include the USB to GPIB adapter. (GPIB0::INTFC).

 

 

 

Download All
0 Kudos
Message 8 of 14
(3,885 Views)

Have you tried reinstalling VISA? Can you replicate the issue on a clean PC/VM? Just curious. I know you have your expected answer now, but it seems more correct to me to fix the issue rather than introducing new risks, like using unsupported functions. 

 

It's interesting though that the code behind the VISA dropdown finds resources a different way than VISA Find Resources does.

Certified LabVIEW Architect
0 Kudos
Message 9 of 14
(3,878 Views)

As i've said before, from what i've managed to investigate, the possible reason is the outdated NI VISA driver, combined with Labview and Windows version.

 

On Windows 7, Labview 2014, NI-VISA 18.5, Visa Function works with filter.

On Windows 7, Labview 2014, NI-VISA 14, Visa Function doesn't work with filter. ( in this configration i can no longer update the NI-VISA to a newer version)

On windows 10, Labview 2014, NI-VISA 19.5, Visa Function works with filter.

 

So, i beleive the solution is keeping NI-VISA updated close to the latest version as possible.

0 Kudos
Message 10 of 14
(3,833 Views)