![]() | ReadBinaryBlockNoPoll |
Reads an IEEE 488.2 definite-length binary block from a device without polling for instrument errors after the read.
virtual HRESULT ReadBinaryBlockNoPoll(double* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override; virtual HRESULT ReadBinaryBlockNoPoll(float* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override; virtual HRESULT ReadBinaryBlockNoPoll(long* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override; virtual HRESULT ReadBinaryBlockNoPoll(short* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override; virtual HRESULT ReadBinaryBlockNoPoll(BYTE* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override; virtual HRESULT ReadBinaryBlockNoPoll(SAFEARRAY** pValues, IoDataType eType, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
[in] Command to send to the device before sending the binary block.
[in] Array of numeric values parsed out of the binary block.
[in] Type of element data for the SAFEARRAY.
[in] Maximum number or elements (not bytes) to read from the device.
[in] If true, characters are read from the device until a valid IEEE 488.2 binary block header is found. If false, the first characters read must be a valid binary block header, else an error is returned.
[in] If true, the formatted I/O read buffer is flushed.
[in] I/O timeout value in milliseconds.
Returns S_OK if successful, otherwise a failure HRESULT.
This function behaves identically to ReadBinaryBlock except that the device is not polled for errors after the data is read.
The following example demonstrates use of the ReadBinaryBlockNoPoll function.
// CoAcme4321.cpp STDMETHODIMP Acme4321::IAcme4321_QueryData(SAFEARRAY** ppsaData) { HRESULT hr = S_OK; hr = io.WriteStringNoPoll(_T("FORM BIN; DATA?")); // Read IEEE 488.2 definite-length binary block hr = io.ReadBinaryBlockNoPoll(ppsaData, IoDataTypeReal64); return hr; }