[in] Command to send to the device before sending the value.
WriteNumberNoPoll
Formats a number as a string and sends it to a device without polling for instrument errors after the write.
Syntax
Section titled “Syntax”virtual HRESULT WriteNumberNoPoll(double value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(float value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(long value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(short value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(BYTE value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(const CString& strCommand, double value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(const CString& strCommand, float value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(const CString& strCommand, long value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(const CString& strCommand, short value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT WriteNumberNoPoll(const CString& strCommand, BYTE value, bool bFlush = true, long lTimeout = CUR_TIMEOUT) override;Parameters
Section titled “Parameters”strCommand
value
[in] Number to format and send to the device.
bFlush
[in] If true, the formatted I/O write buffer is flushed to the device.
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”This function behaves identically to WriteNumber except that the device is not polled for errors after the data is sent.
Example
Section titled “Example”The following example demonstrates use of the WriteNumberNoPoll function.
STDMETHODIMP Acme4321::IAcme4321_Configure(long lCount, double dRange, double dResolution){ HRESULT hr = S_OK;
// Queue up commands in the write buffer hr = io.WriteNumberNoPoll(lCount, false); hr = io.WriteNumberNoPoll(dRange, false);
// Send string and flush buffer to device hr = io.WriteNumber(dResolution);
return hr;}