![]() | PollInstrumentErrors |
Queries the instrument for device errors.
virtual HRESULT PollInstrumentErrors();
Returns S_OK if the device indicated there were no errors, otherwise a failure HRESULT.
By default, the PollInstrumentErrors function issues a "*ESR?" query to the device and parses the response to determine if an error occurred. If an error was reported by the device, an error HRESULT is returned. Driver implementers may override this function to provide specialized logic for interrogating their device for errors.
This function is typically not called directly by user code. Rather, it is used internally in the implementation of various Nimbus Template Library I/O functions, as demonstrated in the example below.
The following example demonstrates use of the PollInstrumentErrors function.
// NtlIo.inl inline HRESULT CIoSession::WriteString(const CString& strData, bool bFlush, long lTimeout) { HRESULT hr = S_OK; hr = WriteStringNoPoll(strData, bFlush, lTimeout); if (SUCCEEDED(hr)) { hr = PollInstrumentErrors(); } return hr; }