AdsSyncReadStateReq

Reads the ADS status and the device status from an ADS server.

LONG AdsSyncReadStateReq(
     PAmsAddr  pAddr,
     USHORT  *pAdsState,
     PUSHORT  pDeviceState
);

Parameter

pAddr

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

pAdsState

[out] Address of a variable that will receive the ADS status (see data type ADSSTATE).

pDeviceState

[out] Address of a variable that will receive the device status.

Return value

Returns the function's error status.

Remarks

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 11 illustrates how the change can be detected with the aid of a callback function.

Example

See example 4.