ReadWrite

Writes a value to an ADS device and reads the result in one step.

HRESULT ReadWrite(
  long  indexGroup,
  long  indexOffset,
  long  cbRdLen,
  long* pcbRead,
  byte* pRdData,
  [in]  long cbWrLen,
  [in,  size_is(cbWrLen)] byte* pWrData
);

Parameter

indexGroup

[in] Variable of type long containing the index group of the variable to be read.

indexOffset

[in] Variable of type long containing the index offset of the variable to be read.

cbRdLen

[in] Number of bytes to be read from the variable.

pcbRead

[out] Pointer to a variable which returns the number of bytes (really) read.

pRdData

[out, size_is(cbRdLen), length_is(*pcbRead)] Pointer to the first element of a byte array with length cbRdLen of the data to be read from a variable in an ADS device.

cbWrLen

[in] Number of bytes to be written to the variable.

pWrData

[in, size_is(pWrData)] Pointer to the first element of a byte array with length cbRdLen of the data to be written to a variable in an ADS device.

Return values

S_OK

The function was called successfully.

ADSERRORCODES

An error occurs.

Comments