11:59, EEST
December 20, 2021
Good morning everyone,
I have a doubt about changing the time and the timezone of the OPC UA server at runtime.
According to the EUROMAP 82.1 / 83 specifications I should manage the following nodes:
The TimeZoneOffset Property represents the difference of the local time to Coordinated Universal Time (UTC)
given by the machine operator or OPC client.
Information: TimeZoneDataType (as defined in OPC UA Part 3) is a structure with two components:
– offset (0:UInt16): Time difference from UTC in minutes (e.g. 120 for daylight saving time in Berlin)
– daylightSavingInOffset (0:Boolean): If TRUE, then daylight saving time (DST) is in effect and offset includes
the DST correction. If FALSE, then the offset does not include DST correction and DST may or may not
have been in effect.
NOTE: The UTC time itself is part of OPC UA Part 5: ServerStatus → CurrentTime.
10.5 SetMachineTime
The SetMachineTime Method allows setting the server time together with TimeZoneOffset.
Signature
SetMachineTime (
[in] 0:DateTime DateTime
[in] 0:TimeZoneDataType TimeZoneOffset);
Do you think it might be a problem to change the time and the timezone of a Java application running the Prosys SDK?
I think the best thing would be to restart the application.
Thanks.
Best regards,
Francesco.
12:51, EEST
April 3, 2012
Hi,
It is per se not possible to “change the timezone of the OPC UA Server”, because there is no such concept in OPC UA (but do read the whole post, in theory maybe there is, but realistically not or like it doesn’t affect anything).
The server always “runs” in UTC and the DateTime DataType always represents the timestamp in UTC when it is transferred in binary between the client and the server. Yes, there is the type https://reference.opcfoundation.org/Core/Part3/v105/docs/8.37 “UtcTime”, but I do not understand thy this type exist since base type of this ‘DateTime’ is already UTC https://reference.opcfoundation.org/Core/Part6/v105/docs/5.2.2.5. Even the UtcTime also says “All time values conveyed between OPC UA Servers and Clients are UTC values. Clients shall provide any conversions between UTC and local time. “. It is possible this is something historical and the type ‘UtcTime’ probably cannot just be removed.
I have limited information, but as far as I’m aware, no-one has ever used the TimeZoneDataType.
In short I do not know what use the ‘SetMachineTime’ does have with that. Maybe the makers of EUROMAP have made a mistake and do not know the above?
Or maybe the timezone is just an extra information, but it wouldn’t like affect at all any time “set by the method”, because that parameter (I assume) is still something DateTime-derived and thus always in UTC (because any simpletype is transferred as the base type rules, thus they must also be in UTC).
I guess it could be of some use to know which timezone the server runs, but it doesn’t affect at all to the timestamps provided by the server. Or I guess in theory IF types derived from String would be used (https://reference.opcfoundation.org/Core/Part3/v105/docs/8.42 or https://reference.opcfoundation.org/Core/Part3/v105/docs/8.46), but I have not seen them ever used.
Note that if you would “set the time of the server”, this would mean setting the time of the Operating System of the machine. And I think probably the timezone as well in the OS level. We do get the time from the system clock.
Changing the clock time on the server could have some implications temporarily, e.g. some java timers do not work that well if the clock “jumps” and may exec really fast temporarily to exec as many times as-if they should have if the time would have flow in a constant manner. Also it might suddenly expire Sessions, SecureChannels and Subscriptions via lifetime-timeouts. In the worst case, it could immediately make a cert unuseable if the clock jumps like years. And I think there was also some requirements that the clocks should be somewhat synchronized when using security, thus, it should be more likely that you run e.g. ‘NTP’ or something that will keep them in sync instead.
Most Users Ever Online: 1919
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 726
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1