03-10-2020 08:32 AM
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
Solved! Go to Solution.
03-10-2020 12:51 PM
@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
03-10-2020 02:58 PM
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
03-10-2020 10:22 PM
There's a private property that returns the list.
03-11-2020 02:16 AM
Hi Paul,
Thanks. This is great. But how do i get to access that property ? 😄
03-11-2020 07:05 AM
03-11-2020 07:21 AM
03-11-2020 07:46 AM
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).
03-11-2020 08:00 AM
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.
03-11-2020 08:08 AM - edited 03-11-2020 08:09 AM
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.