AdsSyncAddDeviceNotificationReq

A notification is defined within an ADS server (e.g. PLC). When a certain event occurs a function (the callback function) is invoked in the ADS client (C program).

LONG AdsSyncAddDeviceNotificationReq(
     PAmsAddr  pAddr,
     ULONG  nIndexGroup,
     ULONG  nIndexOffset,
     PAdsNotificationAttrib  pNoteAttrib,
     PAdsNotificationFuncEx  pNoteFunc,
     ULONG  hUser,
     PULONG  pNotification
);

Parameter

pAddr

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

nIndexGroup

[in] IndexGroup.

nIndexOffset

[in] IndexOffset.

pNoteAttrib

[in] Pointer to the structure that contains further information.

pNoteFunc

[in] Name of the callback function.

hUser

[in] 32-bit value that is passed to the callback function.

pNotification

[out] Address of the variable that will receive the handle of the notification.

Return value

Returns the function's error status.

Limitation:

Per ADS-Port a limitted number of 550 notifications are available.

Example

See example 8.