ITcAdsSync::AddDeviceNotification

Connects a variable to the client. The client will be notified by a event.

HRESULT AddDeviceNotification(
long indexGroup,
long indexOffset,
long cbLenData,
ADSTRANSMODE transMode,
long nMaxDelay,
long nCycleTime,
long* phNotification);

Parameters

indexGroup

[in] A variable of the type long that holds the index group of the variable we want to read.

indexOffset

[in] A variable of the type long that holds the index offset of the variable we want to read.

cbLenData

[in] Count of byte we want to read from the connected variable.

transMode

[out] The mode how the variable is connected with the type ADSTRANSMODE.

nMaxDelay

[in] The time with a resolution of 100 ns after we want to receive an callback on the implemented _ITcAdsSyncEvent interface.

  • nCycleTime
  • [in] The time with a resolution of 100 ns how the variable should be collected

phNotification

[out, retval] A pointer to the handle that unique identifies the connection of our variable.

Return Values

S_OK

The function was successfully called

ADSERRORCODES

An error occurs

Remarks

A nCycleTime= 10000 and nMaxDelay=100000 would receive every 10ms 10 values with the resolution of 1ms.