Click or drag to resize

PollInstrumentErrors

Queries the instrument for device errors.

virtual HRESULT PollInstrumentErrors();
Return Value

Returns S_OK if the device indicated there were no errors, otherwise a failure HRESULT.

Remarks

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.

Example

The following example demonstrates use of the PollInstrumentErrors function.

C++
// 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;
}

Download a complete CHM version of this documentation here.