Click or drag to resize

WriteNumberNoPoll

Formats a number as a string and sends it to a device without polling for instrument errors after the write.

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
strCommand

[in] Command to send to the device before sending the value.

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

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

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

Example

The following example demonstrates use of the WriteNumberNoPoll function.

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

Download a complete CHM version of this documentation here.