The OPCUA Server sets the Servertimestamp in the moment of writing th…#1197
Open
mbay-ODW wants to merge 1 commit intoFreeOpcUa:masterfrom
Open
The OPCUA Server sets the Servertimestamp in the moment of writing th…#1197mbay-ODW wants to merge 1 commit intoFreeOpcUa:masterfrom
mbay-ODW wants to merge 1 commit intoFreeOpcUa:masterfrom
Conversation
…e node, which is from our perspective as specified by the OPCUA guidline. If the Sourcetimestamp is not set by the client, you can use the commented line with SourceTimestamp as well.
swamper123
requested changes
Dec 11, 2020
| if not ua.ua_binary.test_bit(al.Value.Value, ua.AccessLevel.CurrentWrite) or not ua.ua_binary.test_bit(ual.Value.Value, ua.AccessLevel.CurrentWrite): | ||
| res.append(ua.StatusCode(ua.StatusCodes.BadUserAccessDenied)) | ||
| continue | ||
| tz = pytz.timezone('Europe/Berlin') |
Contributor
There was a problem hiding this comment.
I think a fixed timezone "to Europe/Berlin" wouldn't be a good way. Either the servers local time should be passed or handled in another way.
| res.append(ua.StatusCode(ua.StatusCodes.BadUserAccessDenied)) | ||
| continue | ||
| tz = pytz.timezone('Europe/Berlin') | ||
| writevalue.Value.ServerTimestamp = datetime.now(tz) |
Contributor
There was a problem hiding this comment.
datetime.now(tz.utc) would be better, since every time thing on server side is based on UTC. Clients shall provide any conversions between UTC and local time.
| continue | ||
| tz = pytz.timezone('Europe/Berlin') | ||
| writevalue.Value.ServerTimestamp = datetime.now(tz) | ||
| #writevalue.Value.SourceTimestamp = datetime.now(tz) |
Contributor
There was a problem hiding this comment.
No comment is left behind in a PR. ;) You can delte that line, if it is unused.
Member
|
That feature always comes back. I think it was removed due to performance. We should check if we have performance issues with that branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you use an OPCUA Client such as UA Expert from Prosys and change values within the gui than the Servertimestamp is not set while writing the node, which is from our perspective not as specified by the OPCUA guidelines.
The Timestamp will be set to EPOCH Time which is on Windows in the year 1601.
The bug is contained in address_space.py in the write function. There the datavalue for Servertimestamp should be set before writing the node.
See: [(https://github.com//issues/1192)]
If the Sourcetimestamp is not set by the client, you can use the commented line with SourceTimestamp as well.