Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Timestamps - why offset to local time, and their general sematics

More
24 Jan 2023 11:27 #11450 by LithalethuYotsi
Hi guys

I'm happy with the product but cannot find a solution to fix the second issue raised by M."How do I get the timestamp of the last value change based on the time stored in KepServerEX? The timestamp returned seems to be the time the tag was last updated / read by my application and not the time the value actually changed as recorded by KepServerEX? As a result, this value changes every time I restart the application which is a problem." May you please assist ?

Please Log in or Create an account to join the conversation.

More
02 Sep 2014 06:03 #2208 by support
Ad 1. The timestamps in OPC are always in UTC. QuickOPC reflects this by returning timestamps in UTC as well, in a DateTime structure which has its DateTime.Kind set to DateTimeKind.Utc. If you need local time, you should be able to convert the timestamps using methods such as DateTime.ToLocalTime(). Let me know if something does not work as described in this respect, or if you need further help with it.

Ad 2. In general, the data returned from OPC Server are in a form of Value/Timestamp/Quality triples, for which we have a DAVtq class in QuickOPC. We have a strictly followed design rule in QuickOPC in that we never "make up" value or timestamp or quality ourselves, and we never modify them as they come from the server. You can therefore rely on the fact that whenever DAVtq is available (i.e. there is not an error), it *is* the DAVtq that cam from the server.

How the OPC server creates the timestamps is up to the server. In the situation you have described, it looks like that the KepServerEX timestamps a value when it is subscribed to or being read. You need to talk to Kepware about this. Be aware that the precise behavior may be different with a simulated tag versus a real one coming from PLC (or, it may possibly even differ a driver from driver, in their model - I do not know for sure).

Best regards

Please Log in or Create an account to join the conversation.

More
02 Sep 2014 05:54 #2207 by support
From: M.
Sent: Monday, September 01, 2014 10:36 PM
To: ...
Cc: Zbynek Zahradnik
Subject: A couple of questoins re QuickOPC

Gentlemen,

[...] I have been able to make very good progress using QuickOPC and have the following questions:

1) The time returned in the Timestamps is always “later” by 4 hours versus my local machine time. Why? Does this have anything to do with time zone or some other setting?
2) How do I get the timestamp of the last value change based on the time stored in KepServerEX? The timestamp returned seems to be the time the tag was last updated / read by my application and not the time the value actually changed as recorded by KepServerEX? As a result, this value changes every time I restart the application which is a problem.


Regards,
M.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.055 seconds