AdsReadRes

The method AdsReadRes enables the sending of an ADS read response. AdsReadCon forms the counterpart and is subsequently called.

Syntax


int    AdsReadRes( AmsAddr& rAddr, ULONG invokeId, ULONG nResult, ULONG cbLength, PVOID pData );

Parameter

rAddr: (type: AmsAddr&) [in] structure with NetId and port number of the responding ADS server.

invokeId: (type: ULONG) [in] handle of the command that is sent. The InvokeId is specified by the source device and is used for the identification of the commands.

nResult: (type: ULONG) [in] contains the result of the ADS read command; see AdsStatuscodes.

cbLength: (type: ULONG) [in] contains the length in bytes of the data that was read (pData).

pData: (type: PVOID) [in] pointer to the data buffer in which the data are located.

Return value

Type: int

ADS Return Code - see AdsStatuscodes.