LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find resources and resource name

I'm using LV6i and I'm a little bit unhappy with that new data type VISA
resource name which is input to the VISAOpen VI.
If I use the FindResource VI, it returns a list with all the found
resources. How can I select out of this list and wire the result to VISA
resource name input. Is there a function to convert string into
VISAResourceName? I found only VISAResource controls and constants, aren't
there any conversion functions? If not, FindResources is useless, cause you
can't use that information for further processing.
Second question: Is the VISA Resource control a hidden FindResource because
it offers me some resources in my system, but not all of them (in fact, it
offers me COM1 and LPT1 but not GPIB).
Last but not least a question
of a more programming philosophy nature: If I
execute a VISAOpen to a instrument on the GPIB bus, it changes into remote
operation. But why does the VISAClose not the exact reverse the VISAOpen,
e.g sends a GoToLocal to the device, so that the instrument returns into
initial condition ? I find it more consistent to leave a VISA execution
chain with device on local. If I want to set a device into local I have to
use the Misc VI with loc xx input. And this VI doesn't use the VISA resource
name but a string. That's rather inconsistent.

Any opinions?

Oliver Friedrich
0 Kudos
Message 1 of 3
(2,744 Views)
Okay, first, I put strings into VISA resources all the time. A VISA resource name is a special type of string. Create a VISA Resource Name control and then create a local variable from it. Wire your string to the local variable. When the program is run the string will be transferred in to the VISA Resource Name control. Be sure to enable the Allow Undefined Names in the VISA Resource.
A VISA resource control only lists VISA resources that have been defined in NI VISA. If you have another type of VISA loaded on the system, or have not defined aliases in MAX, then they will not show up in the VISA Resource Control. Yes, this is annoying.
I personally would not like VISA close to send a device back to local mode. I do not like languages (or word processors - hear
this Microshaft?), that assume they know what I want to do. There is much more flexibility in letting the user decide when to go to local mode. If you want a close VI that also goes to local, then write your own library routine that does this.

Rob
0 Kudos
Message 2 of 3
(2,744 Views)
Oliver:

As for making the device go to local, use VISA GPIB Control REN with mode 2 or 6. Both send GTL; 2 also deasserts REN. Then call VISA Close and your device will be in the expected state.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 3 of 3
(2,744 Views)