Hi,
It seems that your are trying to use the IVI session handle to perform I/O operations. An IVI session is initialize using the Ivi_SpecificDriverNew function. From the function help:
"Note: This function does not create a VISA session to any instrument resources. If you use VISA to communicate to the instrument, you must create a VISA session yourself and set the IVI_ATTR_IO_SESSION attribute to that value. Otherwise, you can use the IVI_ATTR_IO_SESSION attribute to hold a handle to whatever communications resource you use."
Look at the callback functions as a reference for instrument I/O. First the session is locked and then the IO VISA handle is obtained using Ivi_IOSession. This function returns the VISA handle stored in IVI_ATTR_IO_SESSION.
The driver needs to initialize this attribute with a valid I/O handle (usually VISA).
The tkawg5x0_IviInit function in this driver initializes the attribute by calling viOpen.
Hope this helps.
DiegoF.
National Instruments