ITcAdsSync::Read

This method reads a value of a variable from an ADS device as byte stream

HRESULT Read(
long indexGroup,
long indexOffset,
long cbLen,
long* pcbRead,
byte* pData);

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.

cbLen

[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.

pData

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

Return Values

S_OK

The function was successfully called

ADSERRORCODES

An error occurs