ITcAdsSync::ReadWrite

This method writes a value to an ADS device and receive back the data device in one call.

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

Parameters

indexGroup

[in] A variable of the type long that holds the index group of the variable we want to read.

indexOffset

[in] A variable of the type long that holds the index offset of the variable we want to read.

cbRdLen

[in] Count of byte we want to read from the variable.

pcbRead

[out] Pointer to a variable the returns the count of bytes we really had read.

pRdData

[out, size_is(cbRdLen), length_is(*pcbRead)] A pointer to the first element of a byte array with the length cbRdLen of the data we want to read from a variable in an Ads device.

cbWrLen

[in] Count of byte we want to write to the variable.

pWrData

[in, size_is(pWrData)] A pointer to the first element of a byte array with the length cbWrLen of the data we want to write to a variable in an Ads device.

Return Values

S_OK

The function was successfully called

ADSERRORCODES

An error occurs