[ablegacy] AbLegacy — PLC-5 octal I/O addressing #321

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

Summary

PLC-5 RSLogix 5 uses octal for I:/O: word and bit indices; SLC / MicroLogix use decimal. Today the parser silently accepts both as decimal, misreading real PLC-5 configs.

  • AbLegacyPlcFamilyProfile.cs — new OctalIoAddressing bool. true for Plc5 only; false for Slc500 / MicroLogix / LogixPccc.
  • AbLegacyAddress.cs — new family-aware overload TryParse(string?, AbLegacyPlcFamily?). Parses I:/O: word + bit indices as octal when the family enables it. Defers numeric parsing of the bit suffix until the file letter is known so it picks the right base. Original TryParse(string?) preserved (decimal everywhere) for back-compat.
  • AbLegacyDriver.cs — three call sites updated (read decode, write decode, EnsureTagRuntimeAsync) to pass device.Options.PlcFamily.
  • ToLibplctagName() continues to emit decimal — libplctag's PCCC layer expects decimal regardless of the source format. The record stores decimal values internally.
  • Fixed an XML cref ambiguity warning in AbLegacyDriverOptions.cs.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests110 / 110 passed, including new positives (I:001/17 → word=1 bit=15; I:010/10 → 8/8), octal-digit negatives (I:8/0, I:0/9), SLC500 decimal back-compat, profile flag assertion
  • Integration tests — skipped (live PLC required)

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

Closes #244

## Summary PLC-5 RSLogix 5 uses **octal** for I:/O: word and bit indices; SLC / MicroLogix use decimal. Today the parser silently accepts both as decimal, misreading real PLC-5 configs. - `AbLegacyPlcFamilyProfile.cs` — new `OctalIoAddressing` bool. `true` for Plc5 only; false for Slc500 / MicroLogix / LogixPccc. - `AbLegacyAddress.cs` — new family-aware overload `TryParse(string?, AbLegacyPlcFamily?)`. Parses I:/O: word + bit indices as octal when the family enables it. Defers numeric parsing of the bit suffix until the file letter is known so it picks the right base. Original `TryParse(string?)` preserved (decimal everywhere) for back-compat. - `AbLegacyDriver.cs` — three call sites updated (read decode, write decode, `EnsureTagRuntimeAsync`) to pass `device.Options.PlcFamily`. - `ToLibplctagName()` continues to emit decimal — libplctag's PCCC layer expects decimal regardless of the source format. The record stores decimal values internally. - Fixed an XML cref ambiguity warning in `AbLegacyDriverOptions.cs`. ## 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` — **110 / 110 passed**, including new positives (`I:001/17` → word=1 bit=15; `I:010/10` → 8/8), octal-digit negatives (`I:8/0`, `I:0/9`), SLC500 decimal back-compat, profile flag assertion - [ ] Integration tests — skipped (live PLC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #244. Closes #244
dohertj2 added 1 commit 2026-04-25 13:26:52 -04:00
dohertj2 merged commit ccf2e3a9c0 into auto/driver-gaps 2026-04-25 13:26:56 -04:00
dohertj2 deleted branch auto/ablegacy/1 2026-04-25 13:26:57 -04:00
Sign in to join this conversation.