04-02-2008 04:05 PM
04-04-2008 10:28 AM
10-22-2008 01:53 PM
Hi Paul
the vi session is used by all the top level and Get/Set/Check attribute functions.
The io session is used by all VISA IO operations such as viPrintf, viRead etc. You can get the io session from the vi session as shonw in the "Example" function below
ViStatus Example(ViSession vi)
{
ViStatus error = VI_SUCCESS;
checkErr( Ivi_LockSession (vi, VI_NULL));
if (!Ivi_Simulating(vi)) /* call only when locked */
{
ViSession io = Ivi_IOSession(vi); /* call only when locked */
checkErr( Ivi_SetNeedToCheckStatus (vi, VI_TRUE));
checkErr(viPrintf(io, cCommandString)); //cCommandString is the string you wish to send to the instrument
}
Error:
Ivi_UnlockSession (vi, VI_NULL);
return error;
}