[in] ViSession handle for the driver session.
DriverSession::PollInstrumentErrors
If instrument error polling is enabled, (i.e. the QUERY_INSTR_STATUS attribute is VI_TRUE) this function polls the instrument to determine if an error condition exists.
Syntax
Section titled “Syntax”virtual ViStatus PollInstrumentErrors();
ViStatus PollInstrumentErrors(ViSession Vi);Parameters
Section titled “Parameters”Vi
Return value
Section titled “Return value”Returns a VI_SUCCESS if no instrument error was detected. If an instrument error was detected, this function returns the standard IVI error code IVIC_ERROR_INSTRUMENT_STATUS.
Remarks
Section titled “Remarks”This function is automatically called whenever commands are sent to the instrument. The function should only query the instrument for errors when the QUERY_INSTR_STATUS attribute is VI_TRUE.
The default implementation of PollInstrumentErrors uses the VISA library to send a *ESR? query to the instrument and expects an IEEE 488.2 response.
Example
Section titled “Example”The following code demonstrates how to override the PollInstrumentErrors function:
class Acme4321DriverSession : public DriverSession{public: Acme4321DriverSession(ViSession handle) : DriverSession(handle, 2000, 2000, 2000, false, 1000) { }
virtual ViStatus PollInstrumentErrors() override { auto status = VI_SUCCESS;
// Don't poll unless error polling has been enabled by the client program // if (QueryInstrStatusEnabled()) { // Perform a driver-specific query to determine if there is an error within the instrument // }
return status; }};