Click or drag to resize

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;
			
Parameters
strCommand

[in] Command to send to the device before sending the binary block.

pValues

[in] Array of numeric values parsed out of the binary block.

IoDataType

[in] Type of element data for the SAFEARRAY.

lMaxLength

[in] Maximum number or elements (not bytes) to read from the device.

bSeekToBlock

[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.

bFlush

[in] If true, the formatted I/O read buffer is flushed.

lTimeout

[in] I/O timeout value in milliseconds.

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

This function behaves identically to ReadBinaryBlock except that the device is not polled for errors after the data is read.

Example

The following example demonstrates use of the ReadBinaryBlockNoPoll function.

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

Download a complete CHM version of this documentation here.