Skip to content

fix(s7commplus): use explicit target types for scalar writes - #873

Merged
gijzelaerr merged 1 commit into
masterfrom
fix/s7commplus-explicit-write-types
Sep 9, 2026
Merged

fix(s7commplus): use explicit target types for scalar writes#873
gijzelaerr merged 1 commit into
masterfrom
fix/s7commplus-explicit-write-types

Conversation

@gijzelaerr

Copy link
Copy Markdown
Owner

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-only datatype= 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.

@gijzelaerr
gijzelaerr merged commit e2e24f4 into master Sep 9, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant