tinklerj

Client system time ahead of server

Discussion created by tinklerj on Mar 20, 2013
Latest reply on Mar 22, 2013 by tinklerj

I am posting this in the Pi-SDK forum although it applies to any access method (tested PI-SDK, AF SDK / RDA, PI-API, but probably applies to PI-OLEDB etc as well).

 

I am retrieving values for a particular timestamp using archive calls.  What I want is to get an interpolated value if the timestamp is earlier that the snapshot, else just the snapshot value if the timestamp is later than the snapshot (not trying to extrapolate into the future!).

 

The archive calls tested are:

 

PI-API: piar_getarcvaluex(..., ARCVALUECODE, ...)

 

PI-SDK: ListData.ArcValue(..., RetrievalTypeConstants.rtAuto, ...)

 

AF SDK: PIPointList.RecordedValue(..., AFRetrievalMode.Auto)

 

The application uses a time stamp which is usually only a few seconds before the current time (on the client).

 

This is fine UNLESS the system time on the client is ahead of the system time on the server, so that the timestamp requested is in the future from the server's point of view.  Then, all tags get the value No Data returned.  I assume this is by design, but it's a bit of a nuisance - clients are rarely synchronized to a common time source like servers.

 

Any suggestions for getting round this?  Do I need to measure the time difference on first connection to a server and use a compensation time offset?  How would this be done with PI-SDK/AF SDK?

Outcomes