[in] Command to send to the device before sending the binary block.
ReadBinaryBlock
Reads an IEEE 488.2 definite-length binary block from a device.
Syntax
Section titled “Syntax”virtual HRESULT ReadBinaryBlock(double* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT ReadBinaryBlock(float* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT ReadBinaryBlock(long* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT ReadBinaryBlock(short* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT ReadBinaryBlock(BYTE* pValues, long lMaxLength, long* plActualLength, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT ReadBinaryBlock(SAFEARRAY** pValues, IoDataType eType, bool bSeekToBlock = false, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;Parameters
Section titled “Parameters”strCommand
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 of 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
Section titled “Return value”Returns S_OK if successful, otherwise a failure HRESULT.
Remarks
Section titled “Remarks”The ReadBinaryBlock function reads data from a device and parses it as an IEEE 488.2 definite-length binary block.
Example
Section titled “Example”The following example demonstrates use of the ReadBinaryBlock function.
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.ReadBinaryBlock(ppsaData, IoDataTypeReal64);
return hr;}