[s7] S7 — 64-bit scalar types (LInt/ULInt/LReal/LWord) #336

Merged
dohertj2 merged 1 commits from auto/s7/PR-S7-A1 into auto/driver-gaps 2026-04-25 16:18:42 -04:00
Owner

Summary

Closes the NotSupportedException cliff for S7 64-bit scalar types.

  • S7AddressParser.csS7Size enum gains LWord (8 bytes). Parser accepts new suffix forms:
    • DB{n}.DBLD{off} and DB{n}.DBL{off} for data blocks
    • MLD{off} / ILD{off} / QLD{off} for M/I/Q areas
  • S7Driver.cs — 64-bit Int64/UInt64/Float64 paths now route through Plc.ReadBytesAsync / WriteBytesAsync with explicit big-endian conversion via System.Buffers.Binary.BinaryPrimitives. (S7 wire format is BE; S7netplus has no native LD support.)
  • New internal MapArea(S7Area) helper translates to S7.Net.DataType.
  • Fixed MapDataType so Int16/UInt16/UInt32/Int64/UInt64 surface as their native DriverDataType instead of collapsing to Int32.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.S7 — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.S7.Tests64 / 64 passed (parser theories for the new suffixes + discovery test asserting 64-bit DriverDataType mapping)
  • Integration tests — Snap7-server fixture supports byte-range reads; not exercised in this PR

🤖 Auto-generated by the Mode-B execution loop. Closes #287.

Closes #287

## Summary Closes the `NotSupportedException` cliff for S7 64-bit scalar types. - **`S7AddressParser.cs`** — `S7Size` enum gains `LWord` (8 bytes). Parser accepts new suffix forms: - `DB{n}.DBLD{off}` and `DB{n}.DBL{off}` for data blocks - `MLD{off}` / `ILD{off}` / `QLD{off}` for M/I/Q areas - **`S7Driver.cs`** — 64-bit Int64/UInt64/Float64 paths now route through `Plc.ReadBytesAsync` / `WriteBytesAsync` with explicit big-endian conversion via `System.Buffers.Binary.BinaryPrimitives`. (S7 wire format is BE; S7netplus has no native LD support.) - New internal `MapArea(S7Area)` helper translates to `S7.Net.DataType`. - Fixed `MapDataType` so Int16/UInt16/UInt32/Int64/UInt64 surface as their native `DriverDataType` instead of collapsing to `Int32`. ## Test plan - [x] `dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.S7` — clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.S7.Tests` — **64 / 64 passed** (parser theories for the new suffixes + discovery test asserting 64-bit `DriverDataType` mapping) - [ ] Integration tests — Snap7-server fixture supports byte-range reads; not exercised in this PR 🤖 Auto-generated by the Mode-B execution loop. Closes #287. Closes #287
dohertj2 added 1 commit 2026-04-25 16:18:38 -04:00
Closes the NotSupportedException cliff for S7 Float64/Int64/UInt64.

- S7Size enum gains LWord (8 bytes); parser accepts DBLD/DBL on data
  blocks and LD on M/I/Q (e.g. DB1.DBLD0, DB1.DBL8, MLD0, ILD8, QLD16).
- S7Driver.ReadOneAsync / WriteOneAsync issue ReadBytesAsync /
  WriteBytesAsync for 64-bit types and convert big-endian via
  System.Buffers.Binary.BinaryPrimitives. S7's wire format is BE.
- Internal MapArea(S7Area) helper translates to S7.Net DataType.
- MapDataType now surfaces native DriverDataType for Int16/UInt16/
  UInt32/Int64/UInt64 instead of collapsing them all to Int32.

Tests: parser theories cover DBLD/DBL/MLD/ILD/QLD; discovery test
asserts the 64-bit DriverDataType mapping. 64/64 passing.

Closes #287
dohertj2 merged commit 38eb909f69 into auto/driver-gaps 2026-04-25 16:18:42 -04:00
dohertj2 deleted branch auto/s7/PR-S7-A1 2026-04-25 16:18:43 -04:00
Sign in to join this conversation.