LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 7.0 uses VISA resource name instead of session

It appears as though LabVIEW 7.0 uses a VISA resource name as input to the VI functions (specifically, viClose) instead of a VISA session as required by the VISA standard. I'm trying to write a VISA-compliant instrument driver, which means that my PREFIX_close() function must take a VISA session. Is there any way to get the VISA session from a resource name? Because if not, I'm going to have to break the standard as well and also use a resource name instead of a session, which I don't really want to do.
0 Kudos
Message 1 of 4
(3,084 Views)
What version of LV are you using? This is the standard for making a resource name:

Serial- ASRL[board][::INSTR]

GPIB- GPIB[board]::primary address[::INSTR]

VXI- VXI[board]::VXI logical address[::INSTR]

If you follow this standard and use the visa functions such as visa open,close,read,etc. you shouldn't have any problems. Hope this helps
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 4
(3,084 Views)
I believe that the older versions on NI-VISA, maybe 2.5 outputs refnums, which may be closer to what you are looking for.
0 Kudos
Message 3 of 4
(3,084 Views)
Cathryn:

A VISA session in LabVIEW is the same thing as a VISA refnum is the same thing as a VISA resource name. So your LabVIEW instrument driver VIs should take one of those "things" as an input. It's had different names throughout the versions of LabVIEW, so your confusion is understandable.

In a C instrument driver, the VISA session is a U32 value (that's what the ViSession data type is). If your LabVIEW code needs to call into a C instrument driver, connecting the LabVIEW resource name (refnum, etc.) to a DLL call node U32 input parameter will cause LabVIEW to extract the underlying VISA session number from the LabVIEW structure.

I hope this helps.

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