feat(s7commplus): add batched symbolic read - #871
Open
bvanelli wants to merge 3 commits into
Open
Conversation
Reading several symbolically-addressed variables previously meant one GetMultiVariables round-trip each. read_symbolic_multi packs every address into a single request, which matters most for optimized blocks on S7-1200/1500 where symbolic access is the only reliable path. The existing single-variable builder now delegates to the batched one, so both paths emit identical bytes for a one-item request. Export SymbolicReadItem and DBWriteItem so callers can annotate against the public package rather than reaching into s7commplus.client. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Introduces the
read_symbolic_multi, which is a generalization of theread_symbolic. It is not only backwards compatible, but allows the user to read an entire range of variables with a single request. Tested against a real S7 1500, FW 2.9.8, using a batch of 20 variables.The failure mode when you provide a rejected variable is to log the the hex error, handled by the
_parse_read_response:Since the error is swallowed by the parser, there is a length check for the response, and if variables are missing, a
Runtimeis raised. This should only guard the occasion where the return is[], but the client expected variables.