getCurrentTime() and timestamp discrepancy

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
6 posts • Page 1 of 1
RKoczan
Posts: 6
Joined: Tue Feb 12, 2019 11:30 am

getCurrentTime() and timestamp discrepancy

Post by RKoczan » Thu Mar 14, 2019 4:58 pm

Using a redundant system with 2 servers.

I noticed if I use a getCurrentTime() to determine the time of an event. eg a button click to set a datapoint, the time returned is not the same as the timestamp in the para database against that datapoint.

The time stamp is ahead of the getCurrentTime() value even if the getCurrentTime() is called before the dPSet() . This occurs regardless of which server is the active server and where the test is carried out.

However if I shutdown both servers then only start one the time stamp and the getCurrentTime() are the same. Then if I then start the second server the discrepancy occurs once more.

Can anyone explain the discrepancy?

User avatar
leoknipp
Posts: 1763
Joined: Tue Aug 24, 2010 5:28 pm

Re: getCurrentTime() and timestamp discrepancy

Post by leoknipp » Fri Mar 15, 2019 8:24 am

If you do a dpSet() or dpSetWait() in the UI the timestamp is given by the Event Manager.
Therefore you can have a difference between the time you have seen in the UI and the time written at the dp element.

When you want to set a dp element with a specific time from the UI you have to use dpSetTimed() or dpSetTimedWait().

Best Regards
Leopold Knipp
Senior Support Specialist

RKoczan
Posts: 6
Joined: Tue Feb 12, 2019 11:30 am

Re: getCurrentTime() and timestamp discrepancy

Post by RKoczan » Tue Mar 19, 2019 9:23 am

Thank you for your response.
That was our initial conclusion when running it from our client ui machine, however we also ran the same test from a ui manager running on the server and got a similar result.
Our assumption to date is that because the project is running as a redundant pair then the timestamp applied by the event manager somehow takes into account the times on both the Duty and Standby servers to ensure timestamping of dpe’s is kept in synchronisation after a failover. (We assume this is somehow based on the TimeDiff dpe found in the _ManagerConnections data point type or determined by the redundancy manager, is that correct?)

Can you confirm this is the case as we did notice that when there was approximately a 10 second difference between the Duty and Standby then the timestamp difference for our test also appeared to about 10 seconds different.

User avatar
leoknipp
Posts: 1763
Joined: Tue Aug 24, 2010 5:28 pm

Re: getCurrentTime() and timestamp discrepancy

Post by leoknipp » Tue Mar 19, 2019 1:10 pm

If doing only a dpSet() in a UI manager the active Event Manager is processing the message. The passive Event Manager discards the message as he gets the message from the active one.
The active Event Manager does not take in account any time information for the passive Event Manager when the time stamp is set.

Best Regards
Leopold Knipp
Senior Support Specialist

gschijndel
Posts: 32
Joined: Tue Jan 15, 2019 2:12 pm

Re: getCurrentTime() and timestamp discrepancy

Post by gschijndel » Wed Mar 20, 2019 10:45 am

The event manager buffers received messages until they are processed. So depending on the system load and configuration it can take a bit before the message is processed.

User avatar
leoknipp
Posts: 1763
Joined: Tue Aug 24, 2010 5:28 pm

Re: getCurrentTime() and timestamp discrepancy

Post by leoknipp » Fri Mar 22, 2019 9:45 am

Under normal load conditions the input buffers are very small and therefore you will not see a big difference in sending the message and getting the time stamp by the Event Manager. Especially input buffers for the connection to a UI are very, very small as a Ui is sending only messages on user interaction.
There is normally not a delay of several seconds if a UI is sending a message to the Event Manager.

Best Regards
Leopold Knipp
Senior Support Specialist

Post Reply
6 posts • Page 1 of 1