ADS API
The TimeOffsets can also be queried via ADS. There are two ways to do this
- ADS Notification: ADS notifications contain a time stamp that contains the time at which the data was changed.
An ADS client sends an ADS command before the AddDeviceNotification. This causes the target system to register which type of corrected time stamp is required from this ADS client. - ADS Read: A corrected time stamp can be read out via ADS Read. This can be used to obtain a corrected time stamp in an ADS Sum command at the time when the ADS commands were executed.
Index group | Index offset | Access | Data type | Description | Note |
---|---|---|---|---|---|
ADSIGRP_EXTERNALTIME 0xF088 |
|
|
|
|
|
| ADSIOFFS_EXTERNALTIME_SET
| R | LONG | Read the currently configured offset type for the respective ADS client (AmsNetAddr incl. client port). | The return value is type 0 = None, 1 = Hard, 2 = Medium, 3 = Soft |
| ADSIOFFS_EXTERNALTIME_SET
| W |
| Set the offset type for the ADSDevice notifications of the respective ADS client (AmsNetAddr incl. client port).
| __ is type 0 = None, 1 = Hard, 2 = Medium, 3 = Soft |
| ADSIOFFS_EXTERNALTIME_OFFSET 0x01__ | R | LONGLONG | Reading the current offset for a type. | __ is type: |
| ADSIOFFS_EXTERNALTIME_OFFSET 0x01__ | W | LONGLONG | Setting the current offset for a type. | __ is type: |
| ADSIOFFS_EXTERNALTIME_ABSOLUTE 0x02__ | R | LONGLONG | Reading the corrected time stamp. | __ is type: |
| ADSIOFFS_EXTERNALTIME_PROVIDER 0x03__ | R | ULONG | Reading the object ID from the TimeOffset provider. | __ is type: |
| ADSIOFFS_EXTERNALTIME_SETALL | R | LONG | Reads the type that is used if no other type is set. | The return value is type 0 = None, 1 = Hard, 2 = Medium, 3 = Soft |
| ADSIOFFS_EXTERNALTIME_SETALL 0x04__ | W |
| Sets the type that is used if no other type is set.
| __ is type 0 = None, 1 = Hard, 2 = Medium, 3 = Soft |
The Defines can be found in the file "Ads.h".
The ADS consumer sample illustrates the application.