fix: add SequenceNumber to Get/SetMultiVariables payloads#742
Conversation
|
S7-1200 FW V4.5 requires a VLQ-encoded SequenceNumber field after the ObjectQualifier in all Get/SetMultiVariables requests. Without it the PLC rejects with error 11862009. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22a5c08 to
72e982d
Compare
gijzelaerr
left a comment
There was a problem hiding this comment.
Review
Conflict resolved (test imports only — the client-side changes auto-merged cleanly). Rebased onto current master, pre-commit + tests pass.
The fix is correct. All 6 payload builders (_build_read_payload, _build_write_payload, _build_area_read_payload, _build_area_write_payload, _build_symbolic_read_payload, _build_symbolic_write_payload) now emit encode_uint32_vlq(1) (SequenceNumber = 1) immediately after the ObjectQualifier. The S7-1200 FW V4.5 requires this field; without it the PLC responds with error 11862009.
The tests verify each builder by locating the ObjectQualifier bytes in the output and asserting the next byte is VLQ-encoded 1.
No security concerns. No architectural impact — appends one VLQ byte to existing payloads.
PLC compatibility: S7CommPlus only. The SequenceNumber is harmless on PLCs that don't require it (just an extra ignored field). S7-300/400 legacy snap7/ is untouched.
Ready to merge.
Summary
11862009Closes #738
Test plan
TestSequenceNumber— 6 new tests verify every payload builder includes SequenceNumber after ObjectQualifier🤖 Generated with Claude Code