[abcip] AbCip — Array-slice read addressing Tag[0..N] #319

Merged
dohertj2 merged 1 commits from auto/abcip/1.3 into auto/driver-gaps 2026-04-25 13:06:13 -04:00
Owner

Summary

Adds Tag[N..M] slice syntax to AbCipTagPath.TryParse and a new AbCipArrayReadPlanner that issues a single libplctag read with ElementCount=N and decodes the contiguous buffer into per-index snapshots.

  • AbCipTagPath.cs — slice parsing only on trailing segment; rejects slice+sub-element / slice+bit-index / multi-dim / M<N / negative starts. New AbCipTagPathSlice record (Start, End, Count) and ToLibplctagSliceArrayName().
  • AbCipTagCreateParams.cs + LibplctagTagRuntime.cs — new ElementCount field threaded into libplctag's _tag.ElementCount.
  • AbCipArrayReadPlanner.cs (new) — mirrors UDT-planner pattern. TryBuild returns null for unsupported element types (Bool / String / Structure). Decode walks the buffer at natural Logix stride.
  • AbCipDriver.cs — new ReadSliceAsync path keyed off parsedPath.Slice; one snapshot per slice tag whose Value is object?[] of decoded elements. EnsureSliceRuntimeAsync caches the runtime keyed by tag full-name.

Test plan

  • dotnet build (per-project) — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Tests264 / 264 passed (11 new: 4 slice-parser positive + 9 invalid-shape, 5 planner units, 2 driver-level for DInt success + Bool BadNotSupported)
  • Integration tests — skipped (live PLC required)

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

Closes #227

## Summary Adds `Tag[N..M]` slice syntax to `AbCipTagPath.TryParse` and a new `AbCipArrayReadPlanner` that issues a single libplctag read with `ElementCount=N` and decodes the contiguous buffer into per-index snapshots. - `AbCipTagPath.cs` — slice parsing only on trailing segment; rejects slice+sub-element / slice+bit-index / multi-dim / M<N / negative starts. New `AbCipTagPathSlice` record (`Start`, `End`, `Count`) and `ToLibplctagSliceArrayName()`. - `AbCipTagCreateParams.cs` + `LibplctagTagRuntime.cs` — new `ElementCount` field threaded into libplctag's `_tag.ElementCount`. - `AbCipArrayReadPlanner.cs` (new) — mirrors UDT-planner pattern. `TryBuild` returns null for unsupported element types (Bool / String / Structure). `Decode` walks the buffer at natural Logix stride. - `AbCipDriver.cs` — new `ReadSliceAsync` path keyed off `parsedPath.Slice`; one snapshot per slice tag whose `Value` is `object?[]` of decoded elements. `EnsureSliceRuntimeAsync` caches the runtime keyed by tag full-name. ## Test plan - [x] `dotnet build` (per-project) — clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Tests` — **264 / 264 passed** (11 new: 4 slice-parser positive + 9 invalid-shape, 5 planner units, 2 driver-level for DInt success + Bool BadNotSupported) - [ ] Integration tests — skipped (live PLC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #227. Closes #227
dohertj2 added 1 commit 2026-04-25 13:06:09 -04:00
dohertj2 merged commit 345ac97c43 into auto/driver-gaps 2026-04-25 13:06:13 -04:00
dohertj2 deleted branch auto/abcip/1.3 2026-04-25 13:06:14 -04:00
Sign in to join this conversation.