[s7] S7 — LOGO!/S7-200 V-memory parser #340

Merged
dohertj2 merged 1 commits from auto/s7/PR-S7-A5 into auto/driver-gaps 2026-04-25 17:01:01 -04:00
Owner

Summary

CPU-aware S7 address parsing with V area letter support for S7-200 / S7-200 Smart / LOGO!.

  • New overload S7AddressParser.Parse(string, S7.Net.CpuType?) plus matching TryParse. Accepts V area (VB/VW/VD/V0.0) and rewrites to S7Area.DataBlock with DbNumber=1 for S7200, S7200Smart, and Logo0BA8.
  • Legacy Parse(string) overload delegates and continues to reject V (no CPU context).
  • Modern families (S7-300/400/1200/1500) get a FormatException with a guiding message.
  • LOGO! firmware-band caveat documented in remarks blocks on Parse and on the new VMemoryDbNumberFor helper (central extension point if a site needs non-DB1 mapping).
  • S7Driver.RegisterAsync now passes _options.CpuType into the parser. S7DriverOptions already exposed CpuType — no options change.

Disambiguated one <see cref> warning that surfaced once the new overload was added.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.S7 — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.S7.Tests135 / 135 passed (9 new in S7AddressParserTests: 5 V-memory positives for S7-200/Smart/LOGO!, 4 rejection cases for modern families + CPU-agnostic Parse)
  • Live LOGO! testing — out of scope (firmware-band caveat documented for follow-up)

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

Closes #291

## Summary CPU-aware S7 address parsing with `V` area letter support for S7-200 / S7-200 Smart / LOGO!. - New overload `S7AddressParser.Parse(string, S7.Net.CpuType?)` plus matching `TryParse`. Accepts `V` area (`VB`/`VW`/`VD`/`V0.0`) and rewrites to `S7Area.DataBlock` with `DbNumber=1` for `S7200`, `S7200Smart`, and `Logo0BA8`. - Legacy `Parse(string)` overload delegates and continues to reject `V` (no CPU context). - Modern families (S7-300/400/1200/1500) get a `FormatException` with a guiding message. - LOGO! firmware-band caveat documented in remarks blocks on `Parse` and on the new `VMemoryDbNumberFor` helper (central extension point if a site needs non-DB1 mapping). - `S7Driver.RegisterAsync` now passes `_options.CpuType` into the parser. `S7DriverOptions` already exposed `CpuType` — no options change. Disambiguated one `<see cref>` warning that surfaced once the new overload was added. ## 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` — **135 / 135 passed** (9 new in `S7AddressParserTests`: 5 V-memory positives for S7-200/Smart/LOGO!, 4 rejection cases for modern families + CPU-agnostic `Parse`) - [ ] Live LOGO! testing — out of scope (firmware-band caveat documented for follow-up) 🤖 Auto-generated by the Mode-B execution loop. Closes #291. Closes #291
dohertj2 added 1 commit 2026-04-25 17:00:56 -04:00
Add CPU-aware overload S7AddressParser.Parse(string, CpuType?) that
accepts the V area letter for S7-200 / S7-200 Smart / LOGO! 0BA8 and
maps it to DataBlock DB1. V is rejected on S7-300/400/1200/1500 and on
the legacy CPU-agnostic Parse(string) overload. Width suffixes mirror
M/I/Q (VB/VW/VD/V0.0). S7Driver passes _options.CpuType so live tag
config picks up family-aware parsing.

Tests cover S7200/S7200Smart/Logo0BA8 positive cases, modern-family
rejection, and CPU-agnostic rejection.

Closes #291
dohertj2 merged commit 545cc74ec8 into auto/driver-gaps 2026-04-25 17:01:01 -04:00
dohertj2 deleted branch auto/s7/PR-S7-A5 2026-04-25 17:01:01 -04:00
Sign in to join this conversation.