01-10-2011 05:56 AM
Hi There,
Say I have a "VISA Resource Name" control on my front panel, as per the attached screenshot, that should automatically populate with the names of all the VISA resources that the PC can see.
Is there a way of programmatically getting an array of these names as strings (via a property node, or whatever)?
Many Thanks,
Dan
Solved! Go to Solution.
01-10-2011 06:14 AM
01-10-2011 06:33 AM
From the block diagram go to Instrument I/O > VISA > VISA Advanced > VISA Find Resource. This VI will return an array of strings. You can type cast the string into a VISA Resource type.
01-10-2011 06:53 AM
It should do this automatically but my experience is that the populating of the control is often quite buggy. It also depends on whether you have ports open or not.
The suggestion given already with "Find VISA resource" is probably the best. It's what I normally use.
Shane
01-10-2011 07:01 AM
If I wanted to return the alias (where present), rather than the raw ID of the VISA resource, is there a way of doing that?
Or would it be a case of getting my software to manually parse the visaconf.ini file?
01-10-2011 07:08 AM
Parsing the visaconf.ini would probably the best way to get the alias, at least as far as I know. I'm not sure if there's a way to programmatically get the alias. I've search for quite some time to find a way to do this programmatically but haven't found any real robust solutions. On occasion I've used a property node on the VISA resource to get the Interface Description (LV help states it is not recommended to make decisions based on the description because it could change in the future) and parsed out the "COM#" aliases, but I don't think this a robust or recommended way of doing it.
01-10-2011 07:17 AM
It's possible to get aliases by using the proper "search mode" as input for the VISA Find Resource function. Please check the function help.
01-10-2011 07:20 AM
I must have read over that part in the help, that's extremely useful, no parsing, no file reading. Thanks.