AdsWriteControlReq

The method AdsWriteControlReq permits to send an ADS write control command for changing the ADS status and the device status of an ADS server. The AdsWriteControlCon will be called on arrival of the answer.

Syntax


int AdsWriteControlReq( AmsAddr& rAddr, ULONG invokeId, USHORT adsState,
    USHORT deviceState, ULONG cbLength, 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.

adsState: (Type: USHORT) [in] new ADS state (see enum nAdsState in Ads.h).

deviceState: (Type: USHORT) [in] new device state.

cbLength: (type: ULONG) [in] contains the length in bytes of the data (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.