Instrument Control (GPIB, Serial, VISA, IVI)

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 2
(3,664 Views)
Are you using Call Library Function Node to call prefix_close()? If so, the function node will automatically convert a resource name to a session. Check out the KB at http://digital.ni.com/public.nsf/websearch/FB001AA027C8998386256AAD006C142D?OpenDocument

"the Call Library Function Node performs this conversion. If you wire a VISA resource name or VISA refnum to an 32-bit integer input terminal of a Call Library Function Node, the node coerces the refnum into a valid session ID, which you can use in your external code. You also can use this method to call functions in the Visa32.dll directly from LabVIEW."

You could also get the VISA session from the instrument driver with:
prefix_GetAttributeViSession(instHandle, "",TEST_ATTR_IO_SESSION, &visaSession);
wher
e prefix is the prefix of your instrument driver.

Hope this helps.

A.S.
Anu Saha
Academic Product Marketing Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,664 Views)