Phase 3 PR 57 -- S7 byte-order + fingerprint integration tests #56

Merged
dohertj2 merged 1 commits from phase-3-pr57-s7-quirk-tests into v2 2026-04-18 23:10:16 -04:00
Owner

Summary

Three new facts in S7_ByteOrderTests:

  1. S7_Float32_ABCD_decodes_1_5f_from_HR100 — reads HR[100..101] with BigEndian AND WordSwap; asserts BigEndian==1.5f, WordSwap!=1.5f. Proves S7's ABCD default (opposite of DL260).
  2. S7_Int32_ABCD_decodes_0x12345678_from_HR300 — same ABCD proof for Int32.
  3. S7_DB1_fingerprint_marker_at_HR0_reads_0xABCD — DB1.DBW0 fingerprint convention.

No driver code changes — locks in S7-specific semantics at the integration level so future codec refactors can't silently break S7.

Quirks NOT testable via pymodbus (MB_SERVER STATUS 0x8383, port-per-connection, CP 343-1 Lean license, STOP-mode non-determinism) remain in docs/v2/s7.md as design guidance rather than automated tests.

Validation

  • 4/4 S7 integration tests pass (smoke + 3 quirk)
  • No unit test regressions
## Summary Three new facts in `S7_ByteOrderTests`: 1. `S7_Float32_ABCD_decodes_1_5f_from_HR100` — reads HR[100..101] with BigEndian AND WordSwap; asserts `BigEndian==1.5f`, `WordSwap!=1.5f`. Proves S7's ABCD default (opposite of DL260). 2. `S7_Int32_ABCD_decodes_0x12345678_from_HR300` — same ABCD proof for Int32. 3. `S7_DB1_fingerprint_marker_at_HR0_reads_0xABCD` — DB1.DBW0 fingerprint convention. No driver code changes — locks in S7-specific semantics at the integration level so future codec refactors can't silently break S7. Quirks NOT testable via pymodbus (MB_SERVER STATUS 0x8383, port-per-connection, CP 343-1 Lean license, STOP-mode non-determinism) remain in docs/v2/s7.md as design guidance rather than automated tests. ## Validation - 4/4 S7 integration tests pass (smoke + 3 quirk) - No unit test regressions
dohertj2 added 1 commit 2026-04-18 23:10:12 -04:00
Phase 3 PR 57 -- S7 byte-order + fingerprint integration tests against s7_1500 pymodbus profile. Three facts in new S7_ByteOrderTests class: (1) S7_Float32_ABCD_decodes_1_5f_from_HR100 reads HR[100..101] with ModbusByteOrder.BigEndian AND with WordSwap on the same wire bytes; asserts BigEndian==1.5f AND WordSwap!=1.5f -- proving both that Siemens S7 stores Float32 in ABCD word order (opposite of DL260 CDAB) and that the ByteOrder flag is not a no-op on the same wire buffer. (2) S7_Int32_ABCD_decodes_0x12345678_from_HR300 reads HR[300]=0x1234 + HR[301]=0x5678 with BigEndian and asserts the reassembled Int32 = 0x12345678; documents the contrast with DL260 CDAB Int32 encoding. (3) S7_DB1_fingerprint_marker_at_HR0_reads_0xABCD reads HR[0]=0xABCD -- real MB_SERVER deployments reserve DB1.DBW0 as a fingerprint so clients can verify they're pointing at the right DB, protecting against typos in the MB_SERVER.MB_HOLD_REG.DB_number parameter. No driver code changes -- the ByteOrder.BigEndian path has existed since PR 24; this PR exists to lock in the S7-specific semantics at the integration level so future refactors of NormalizeWordOrder can't silently break S7. All 3 tests gate on MODBUS_SIM_PROFILE=s7_1500 so they skip cleanly against dl205 or standard profiles. Verified end-to-end: 4/4 S7 integration tests pass (1 smoke from PR 56 + 3 new). No regression in driver unit tests. Per the per-quirk-PR plan: the S7 quirks NOT testable via pymodbus sim (MB_SERVER STATUS 0x8383 optimized-DB behavior, port-per-connection semantics, CP 343-1 Lean license rejection, STOP-mode non-determinism) remain in docs/v2/s7.md as design guidance for driver users rather than automated tests -- they're TIA-Portal-side or CP-hardware-side behaviors that pymodbus cannot reproduce without custom Python actions. b54724a812
dohertj2 merged commit 9ccc7338b8 into v2 2026-04-18 23:10:16 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#56