AdsSyncWriteControlReq

Changes the ADS status and the device status of an ADS server.

LONG AdsSyncWriteControlReq(
     PAmsAddr  pAddr,
     USHORT  nAdsState,
     USHORT  nDeviceState,
     ULONG  nLength,
     PVOID  pData
);

Parameter

pAddr

[in] Structure with NetId and port number of the ADS server.

nAdsState

[in] New ADS status.

nDeviceState

[in] New device status.

nLength

[in] Length of the data in bytes.

pData

[in] Pointer to data sent additionally to the ADS device.

Return value

Returns the function's error status.

Comments

In addition to changing the ADS status and the device status, it is also possible to send data to the ADS server in order to transfer further information. In the current ADS devices (PLC, NC, ...) this data has no further effect. Any ADS device can inform another ADS device of its current state. A distinction is drawn here between the status of the device itself (DeviceState) and the status of the ADS interface of the ADS device (AdsState). The states that the ADS interface can adopt are laid down in the ADS specification.

Example

See example 6.