Repository navigation
Add a read_only flag to Server.register_area - #992
Open
gijzelaerr wants to merge 2 commits into
Open
gijzelaerr wants to merge 2 commits into
gijzelaerr wants to merge 2 commits into
Conversation
A real S7-1214C V4.2 answers a Write Var to a write-protected DB with item return code 0x03, "accessing the object not allowed", and no header error (capture in #976). The server can now emulate that. - register_area() takes a keyword-only read_only argument. Registering the area again, or unregistering it, drops the flag. - A write to a read-only area is refused with item code 0x03 in both the single-item and the multi-item path. Nothing is written and no data-write event is emitted. Read-only is checked before the range; there is no capture of an out-of-range write to a protected DB. - Reads, a block download and changes the server side makes to the buffer are not affected.
This branch has not been deployed
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.
A real S7-1214C V4.2 answers a Write Var to a write-protected DB with item return code
0x03, "accessing the object not allowed", and no header error (capture in #976). The server can now emulate that.Changes
Server.register_area()takes a keyword-onlyread_onlyargument. Registering the area again, or unregistering it, drops the flag.0x03in both the single-item and the multi-item path. Nothing is written and no data-write event is emitted.Not covered
Read-only is checked before the range. There is no capture of an out-of-range write to a protected DB, so the code a real CPU returns for that case is unknown.
Testing
New tests in
tests/test_server.pycover both write paths, the unchanged read path, the event log, and dropping the flag on re-registration.Refs #976