fix(s7commplus): use explicit target types for scalar writes - #873
Merged
Conversation
This was referenced Sep 9, 2026
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.
Scalar writes could be sent as BLOB even when the PLC requires an INT, REAL, or another specific datatype. Hardware feedback in #819 confirmed BLOB rejection and successful explicitly typed integer writes; #844 reports a matching symbolic-write error.
Require
(db_number, start_offset, data, datatype)tuples in the new sync/async multi-write API, rejecting missing types before sending. Add keyword-onlydatatype=to symbolic and area writes in both clients and propagate it through the synchronous substreamed area path. Existing single-write defaults remain compatible; examples now use explicit scalar types. Explicit BLOB is retained for targets that support it. Raw DB offsets are not claimed to be equivalent to symbolic paths.The multi-write tuple change deliberately tightens an unreleased 4.0 API. The related #844 diagnosis still needs a hardware retest, so this PR does not automatically close that issue.
Validation: 1,944 passed, 78 skipped; all pre-commit hooks and source/wheel builds passed. Regression tests check INT/WORD/DINT/UDINT/REAL wire encodings through the sync/async public APIs and ensure malformed multi-write input cannot send an earlier item in the substreamed path. Full mypy reports 207 pre-existing errors versus 208 on unchanged master, with no new diagnostics.
Refs #819, #844.