Ivi_SetNeedToCheckStatus
Usage
ViStatus Ivi_SetNeedToCheckStatus(ViSession vi, ViBoolean needToCheckStatus);
Purpose
This function allows an instrument driver to indicate whether it is necessary to check the status of the instrument.
The IVI engine maintains an internal needToCheckStatus variable for each session indicating whether it is necessary to check the status of the instrument. When you create a new session, the initial value of the variable is VI_TRUE. The IVI engine sets the needToCheckStatus variable to VI_TRUE when it invokes the read callback or write callback for an attribute for which the IVI_VAL_DONT_CHECK_STATUS flag is 0. The Ivi_WriteInstrData and Ivi_WriteFromFile functions also set the variable to VI_TRUE. The IVI engine sets the variable to VI_FALSE after it invokes the check status callback successfully.
The Ivi_SetNeedToCheckStatus function allows an instrument driver to set the state of the internal needToCheckStatus variable. A driver typically sets the variable to VI_TRUE before it attempts direct instrument I/O. It sets it to VI_FALSE after it calls the check status callback successfully.
Note Do not call this function unless you have already locked the session. |
Parameters
Name | Type | Description |
---|---|---|
vi | ViSession |
The ViSession handle that you obtain from Ivi_SpecificDriverNew. The handle identifies a particular IVI session. |
needToCheckStatus | ViBoolean |
Pass VI_TRUE before you attempt to interact with the instrument directly rather than through Ivi_SetAttribute, Ivi_GetAttribute, Ivi_WriteInstrData or Ivi_WriteFromFile functions. Pass VI_FALSE after you invoke the check status callback successfully. |
Return Value
Contains the status code that the function call returns. IVI engine functions can return error and warning values from several sets of status codes. Some status codes are unique to the IVI engine. Other status codes are the same codes that VISA Library functions return. Still others are error or warning values that functions in specific instrument drivers return. Each set of status codes has its own numeric range.
Regardless of the source of the status code, 0 always indicates success, a positive value indicates a warning, and a negative value indicates an error.