[in] Command string to send to the device.
QueryList
Performs a write and read of a delimited list of results as a single operation.
Syntax
Section titled “Syntax”virtual HRESULT QueryList(const CString& strCommand, double* pValues, long lMaxLength, long* plActualLength, const CString& strListSeparator = _T(","), long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT QueryList(const CString& strCommand, float* pValues, long lMaxLength, long* plActualLength, const CString& strListSeparator = _T(","), long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT QueryList(const CString& strCommand, long* pValues, long lMaxLength, long* plActualLength, const CString& strListSeparator = _T(","), long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT QueryList(const CString& strCommand, short* pValues, long lMaxLength, long* plActualLength, const CString& strListSeparator = _T(","), long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT QueryList(const CString& strCommand, BYTE* pValues, long lMaxLength, long* plActualLength, const CString& strListSeparator = _T(","), long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT QueryList(const CString& strCommand, CComBSTR* pValues, long lMaxLength, long* plActualLength, const CString& strListSeparator = _T(","), long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT QueryList(const CString& strCommand, SAFEARRAY** pValues, IoDataType eType, const CString& strListSeparator = _T(","), long lTimeout = CUR_TIMEOUT) abstract;Parameters
Section titled “Parameters”strCommand
pValues
[out] Array of delimited values parsed from the device.
lMaxLength
[in] Maximum number of elements (not bytes) to read from the device.
plActualLength
[out] Actual number of elements (not bytes) read from the device.
strListSeparator
[in] Set of characters that act as delimiters between elements in the list.
Return value
Section titled “Return value”Returns S_OK if successful, otherwise a failure HRESULT.
Remarks
Section titled “Remarks”The QueryList function provides a mechanism of “send, then receive” typical to a device command sequence. In this manner, the response generated from the command can be read immediately. The device is not polled for errors after the write portion of the sequence.
The QueryList function performs a WriteStringNoPoll operation followed immediately by a ReadList operation.
List elements in the response can be separated by any of the characters in the strListSeparator parameter.
If each element in the device response could not be parsed into the type requested, this function returns an error.
Example
Section titled “Example”The following example demonstrates use of the QueryList function.
STDMETHODIMP Acme4321::IAcme4321_QueryData(SAFEARRAY** ppsa){ HRESULT hr = S_OK;
// Instrument response is: // 1.43,2E-6,5.66 hr = io.QueryList(_T("DATA?"), ppsa, IoDataTypeReal64);
return hr;}