AdsReadWriteReq

The method AdsReadWriteReq permits to send an ADS readwrite command, for the transfer of data to and from an ADS device. The AdsReadWriteCon will be called on arrival of the answer.

Syntax


int AdsReadWriteReq( AmsAddr& rAddr, ULONG invokeId, ULONG indexGroup, ULONG indexOffset, ULONG cbReadLength, ULONG cbWriteLength, PVOID pData );

Parameter

rAddr: (type: AmsAddr&) [in] structure with NetId and port number of the 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.

indexGroup: (Type: ULONG) [in] contains the index group number (32-bit, unsigned) of the requested ADS service.

indexOffset: (Type: ULONG) [in] contains the index offset number (32-bit, unsigned) of the requested ADS service.

cbReadLength: (type: ULONG) [in] contains the length in bytes of the data to be read (pData).

cbWriteLength: (type: ULONG) [in] contains the length in bytes of the data to be written (pData).

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

Return value

Type: int

Error code, see AdsStatuscodes.