[ablegacy] AbLegacy — Indirect/indexed addressing parser #324

Merged
dohertj2 merged 1 commits from auto/ablegacy/4 into auto/driver-gaps 2026-04-25 13:53:30 -04:00
Owner

Summary

Adds indirect / indexed addressing parser:

  • N7:[N7:0] — file letter N, file 7, word number resolved at runtime from N7:0
  • N[N7:0]:5 — file letter N, file number resolved at runtime from N7:0, word 5
  • Both at once (N[N7:0]:[N7:1]), and bit-after-bracket (N7:[N7:0]/3)

AbLegacyAddress gains optional IndirectFileSource and IndirectWordSource (each itself an AbLegacyAddress) plus an IsIndirect flag. ParseInner rejects any inner address containing further [/] — recursion capped at 1. Top-level colon/dot detection is bracket-aware. PLC-5 octal-IO rules cascade into the inner address.

ToLibplctagName() re-emits the bracket form. libplctag PCCC doesn't decode bracket-form indirection natively, so EnsureTagRuntimeAsync throws NotSupportedException for indirect addresses with a TODO(#247) note for the two-step resolve-then-read. Runtime resolution intentionally deferred per the issue's guidance.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests233 / 233 passed (11 new: indirect positives, depth>1 rejection, malformed brackets, bit-after-bracket, octal-on-inner-PLC-5)
  • Integration tests — skipped (live PLC required)

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

Closes #247

## Summary Adds indirect / indexed addressing parser: - `N7:[N7:0]` — file letter `N`, file `7`, word number resolved at runtime from `N7:0` - `N[N7:0]:5` — file letter `N`, file number resolved at runtime from `N7:0`, word `5` - Both at once (`N[N7:0]:[N7:1]`), and bit-after-bracket (`N7:[N7:0]/3`) `AbLegacyAddress` gains optional `IndirectFileSource` and `IndirectWordSource` (each itself an `AbLegacyAddress`) plus an `IsIndirect` flag. `ParseInner` rejects any inner address containing further `[`/`]` — recursion capped at 1. Top-level colon/dot detection is bracket-aware. PLC-5 octal-IO rules cascade into the inner address. `ToLibplctagName()` re-emits the bracket form. libplctag PCCC doesn't decode bracket-form indirection natively, so `EnsureTagRuntimeAsync` throws `NotSupportedException` for indirect addresses with a `TODO(#247)` note for the two-step resolve-then-read. Runtime resolution intentionally deferred per the issue's guidance. ## Test plan - [x] `dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy` — clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests` — **233 / 233 passed** (11 new: indirect positives, depth>1 rejection, malformed brackets, bit-after-bracket, octal-on-inner-PLC-5) - [ ] Integration tests — skipped (live PLC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #247. Closes #247
dohertj2 added 1 commit 2026-04-25 13:53:26 -04:00
dohertj2 merged commit 5b4925e61a into auto/driver-gaps 2026-04-25 13:53:30 -04:00
dohertj2 deleted branch auto/ablegacy/4 2026-04-25 13:53:31 -04:00
Sign in to join this conversation.