[abcip] AbCip — L5K parser + ingest #346

Merged
dohertj2 merged 1 commits from auto/abcip/2.1 into auto/driver-gaps 2026-04-25 18:03:33 -04:00
Owner

Summary

L5K (Studio 5000) tag-export parser and ingest path.

  • Import/IL5kSource.cs — abstraction for file-path or inline-text input.
  • Import/L5kParser.cs — pure-text parser:
    • TAG / END_TAG blocks with Name, DataType, ExternalAccess, AliasFor, Description
    • DATATYPE / END_DATATYPE UDT definitions with MEMBER lines (incl. array dims)
    • PROGRAM / END_PROGRAM scope wrappers
    • Strips (* … *) block comments
    • Tolerates multi-line entries terminated by ;
    • Unknown sections silently skipped
  • Import/L5kIngest.cs — converts parsed result to AbCipTagDefinition[] + matching UDT AbCipStructureMember lists. Skips alias tags and ExternalAccess=None tags (Kepware precedent — documented in remarks).
  • AbCipDriverOptions — new L5kImports collection of AbCipL5kImportOptions (file path or inline text, target device, name prefix).
  • AbCipDriver.InitializeAsync — parses each import, ingests, merges into the per-name tag map. Declared Tags win on collision so operators can override import results.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.AbCip — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Tests286 / 286 passed (17 new: controller- and program-scope TAGs, alias skip, DATATYPE with array-dim member, comment stripping, unknown-section skip, multi-line continuation, ingest path incl. ExternalAccess=None/ReadOnly + UDT-typed tag fanout)
  • Integration tests — skipped (live PLC required)

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

Closes #229

## Summary L5K (Studio 5000) tag-export parser and ingest path. - `Import/IL5kSource.cs` — abstraction for file-path or inline-text input. - `Import/L5kParser.cs` — pure-text parser: - `TAG / END_TAG` blocks with `Name`, `DataType`, `ExternalAccess`, `AliasFor`, `Description` - `DATATYPE / END_DATATYPE` UDT definitions with `MEMBER` lines (incl. array dims) - `PROGRAM / END_PROGRAM` scope wrappers - Strips `(* … *)` block comments - Tolerates multi-line entries terminated by `;` - Unknown sections silently skipped - `Import/L5kIngest.cs` — converts parsed result to `AbCipTagDefinition[]` + matching UDT `AbCipStructureMember` lists. Skips alias tags and `ExternalAccess=None` tags (Kepware precedent — documented in remarks). - `AbCipDriverOptions` — new `L5kImports` collection of `AbCipL5kImportOptions` (file path or inline text, target device, name prefix). - `AbCipDriver.InitializeAsync` — parses each import, ingests, merges into the per-name tag map. **Declared `Tags` win on collision** so operators can override import results. ## Test plan - [x] `dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.AbCip` — clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Tests` — **286 / 286 passed** (17 new: controller- and program-scope TAGs, alias skip, DATATYPE with array-dim member, comment stripping, unknown-section skip, multi-line continuation, ingest path incl. ExternalAccess=None/ReadOnly + UDT-typed tag fanout) - [ ] Integration tests — skipped (live PLC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #229. Closes #229
dohertj2 added 1 commit 2026-04-25 18:03:29 -04:00
Pure-text parser for Studio 5000 L5K controller exports. Recognises
TAG/END_TAG, DATATYPE/END_DATATYPE, and PROGRAM/END_PROGRAM blocks,
strips (* ... *) comments, and tolerates multi-line entries + unknown
sections (CONFIG, MOTION_GROUP, etc.). Output records — L5kTag,
L5kDataType, L5kMember — feed L5kIngest which converts to
AbCipTagDefinition + AbCipStructureMember. Alias tags and
ExternalAccess=None tags are skipped per Kepware precedent.

AbCipDriverOptions gains an L5kImports collection
(AbCipL5kImportOptions records — file path or inline text + per-import
device + name prefix). InitializeAsync merges the imports into the
declared Tags map, with declared tags winning on Name conflicts so
operators can override import results without editing the L5K source.

Tests cover controller-scope TAG, program-scope TAG, alias-tag flag,
DATATYPE with member array dims, comment stripping, unknown-section
skipping, multi-line entries, and the full ingest path including
ExternalAccess=None / ReadOnly / UDT-typed tag fanout.

Closes #229

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit 2731318c81 into auto/driver-gaps 2026-04-25 18:03:33 -04:00
dohertj2 deleted branch auto/abcip/2.1 2026-04-25 18:03:34 -04:00
Sign in to join this conversation.