[ablegacy] AbLegacy — PD/MG/PLS/BT structure files #352

Merged
dohertj2 merged 1 commits from auto/ablegacy/5 into auto/driver-gaps 2026-04-25 19:11:14 -04:00
Owner

Summary

Adds PD (PID), MG (Message), PLS (Programmable Limit Switch), BT (Block Transfer) structure files to the AbLegacy PCCC parser.

  • AbLegacyAddress.cs — new IsStructureFileLetter + StructureFileSupported per-family gating.
  • AbLegacyDataType.cs — four new enum members (PidElement, MessageElement, PlsElement, BlockTransferElement) + Float/Int/Boolean sub-element catalogue + Rockwell-correct status-bit indices + read-only PLC-set bit list. Reuses the bit-semantics machinery shipped in ablegacy-3.
  • LibplctagLegacyTagRuntime.cs — Decode/Encode dispatch using GetFloat32 for PD non-bit members and GetInt32 for MG/BT/PLS; GetBit for status bits.
  • AbLegacyPlcFamilyProfile.cs — four new per-family flags.

Per-family gating:

  • PD / MG → SLC500 + PLC-5
  • PLS / BT → PLC-5 only
  • MicroLogix + LogixPccc → reject all four
  • family-less default → rejects (back-compat)

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests296 / 296 passed (7 new test cases / ~28 inline data rows in AbLegacyAddressTests: per-family acceptance + rejection, sub-element bit semantics, Float vs Int dispatch)
  • Integration tests — skipped (live PLC required)

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

Closes #248

## Summary Adds PD (PID), MG (Message), PLS (Programmable Limit Switch), BT (Block Transfer) structure files to the AbLegacy PCCC parser. - **`AbLegacyAddress.cs`** — new `IsStructureFileLetter` + `StructureFileSupported` per-family gating. - **`AbLegacyDataType.cs`** — four new enum members (`PidElement`, `MessageElement`, `PlsElement`, `BlockTransferElement`) + Float/Int/Boolean sub-element catalogue + Rockwell-correct status-bit indices + read-only PLC-set bit list. Reuses the bit-semantics machinery shipped in ablegacy-3. - **`LibplctagLegacyTagRuntime.cs`** — Decode/Encode dispatch using `GetFloat32` for PD non-bit members and `GetInt32` for MG/BT/PLS; `GetBit` for status bits. - **`AbLegacyPlcFamilyProfile.cs`** — four new per-family flags. **Per-family gating**: - PD / MG → SLC500 + PLC-5 - PLS / BT → PLC-5 only - MicroLogix + LogixPccc → reject all four - family-less default → rejects (back-compat) ## 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` — **296 / 296 passed** (7 new test cases / ~28 inline data rows in `AbLegacyAddressTests`: per-family acceptance + rejection, sub-element bit semantics, Float vs Int dispatch) - [ ] Integration tests — skipped (live PLC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #248. Closes #248
dohertj2 added 1 commit 2026-04-25 19:11:09 -04:00
Adds PD (PID), MG (Message), PLS (Programmable Limit Switch) and BT
(Block Transfer) file types to the PCCC parser. New AbLegacyDataType
enum members (PidElement / MessageElement / PlsElement /
BlockTransferElement) plus per-type sub-element catalogue:

  - PD: SP/PV/CV/KP/KI/KD/MAXS/MINS/DB/OUT as Float32; EN/DN/MO/PE/
        AUTO/MAN/SP_VAL/SP_LL/SP_HL as Boolean (word-0 status bits).
  - MG: RBE/MS/SIZE/LEN as Int32; EN/EW/ER/DN/ST/CO/NR/TO as Boolean.
  - PLS: LEN as Int32 (bit table varies per PLC).
  - BT: RLEN/DLEN as Int32; EN/ST/DN/ER/CO/EW/TO/NR as Boolean.

Per-family flags on AbLegacyPlcFamilyProfile gate availability:

  - PD/MG: SLC500 + PLC-5 (operator + status bits both present).
  - PLS/BT: PLC-5 only (chassis-IO block transfer is PLC-5-specific).
  - MicroLogix + LogixPccc: rejected — no legacy file-letter form.

Status-bit indices match Rockwell DTAM / 1747-RM001 / 1785-6.5.12:
PD word 0 bits 0-8, MG/BT word 0 bits 8-15. PLC-set status bits
(PE/DN/SP_*; ST/DN/ER/CO/EW/NR/TO) are surfaced as ViewOnly via
IsPlcSetStatusBit, matching the Timer/Counter/Control pattern from
ablegacy-3.

LibplctagLegacyTagRuntime decodes PD non-bit members as Float32 and
MG/BT/PLS non-bit members as Int32; status bits route through GetBit
with the bit-position encoded by the driver via StatusBitIndex.

Tests: parser positive cases per family + negative cases per family,
catalogue + bit-index + read-only-bit assertions.

Closes #248
dohertj2 merged commit 2fc71d288e into auto/driver-gaps 2026-04-25 19:11:14 -04:00
dohertj2 deleted branch auto/ablegacy/5 2026-04-25 19:11:14 -04:00
Sign in to join this conversation.