AbLegacy Test Connect probe passes the raw ProbeAddress (PLC-5 octal probe address read as decimal) #660

Closed
opened 2026-10-09 05:41:49 -04:00 by dohertj2 · 1 comment
Owner

Found by the #659 review (2026-10-09), pre-existing.

AbLegacyDriverProbe.cs:97-106 (Test Connect) passes ProbeAddress to the tag factory without normalising it through the family-aware AbLegacyAddress parser, unlike the driver's own read/write/probe paths. On PLC-5 (and LogixPccc), I/O element numbers are authored in octal and must be converted to decimal before reaching the transport, so a probe address like I:017 would address element 17 decimal instead of 15.

Impact is narrow: the default probe S:0 is unaffected, and only a PLC-5 Test Connect with a custom octal I/O probe address is wrong. Fix: parse/normalise the probe address with the device's family (same as the driver probe loop) before creating the runtime; add a unit test with a PLC-5 octal probe address.

Found by the #659 review (2026-10-09), pre-existing. `AbLegacyDriverProbe.cs:97-106` (Test Connect) passes `ProbeAddress` to the tag factory without normalising it through the family-aware `AbLegacyAddress` parser, unlike the driver's own read/write/probe paths. On PLC-5 (and LogixPccc), I/O element numbers are authored in octal and must be converted to decimal before reaching the transport, so a probe address like `I:017` would address element 17 decimal instead of 15. Impact is narrow: the default probe `S:0` is unaffected, and only a PLC-5 Test Connect with a custom octal I/O probe address is wrong. Fix: parse/normalise the probe address with the device's family (same as the driver probe loop) before creating the runtime; add a unit test with a PLC-5 octal probe address.
dohertj2 referenced this issue from a commit 2026-10-09 07:19:56 -04:00
Author
Owner

Fixed and pushed in master ea220363 (merge ede40b6c, branch commit c0fbe746). Test Connect now normalises the probe address through the same family-aware parser as the driver's probe loop (new AbLegacyProbeAddress.Normalise → AbLegacyAddress.TryParse(...).ToLibplctagName()), so a PLC-5 I:017 probe becomes I:15 (octal → decimal) and then composes with the #659 libplctag translation (I1:15). An unparseable probe address now returns a clean Ok=false ("not a valid AbLegacy address for this PLC family") instead of throwing. SLC/MicroLogix/LogixPccc unchanged. Tests: AbLegacyDriverProbeTests 14/14 (7 fail with the fix reverted); AbLegacy.Tests 595 green; full suite 13214 passed / 0 failed. Docs: AbLegacy.md.

Fixed and pushed in master `ea220363` (merge `ede40b6c`, branch commit `c0fbe746`). Test Connect now normalises the probe address through the same family-aware parser as the driver's probe loop (new `AbLegacyProbeAddress.Normalise` → `AbLegacyAddress.TryParse(...).ToLibplctagName()`), so a PLC-5 `I:017` probe becomes `I:15` (octal → decimal) and then composes with the #659 libplctag translation (`I1:15`). An unparseable probe address now returns a clean Ok=false ("not a valid AbLegacy address for this PLC family") instead of throwing. SLC/MicroLogix/LogixPccc unchanged. Tests: AbLegacyDriverProbeTests 14/14 (7 fail with the fix reverted); AbLegacy.Tests 595 green; full suite 13214 passed / 0 failed. Docs: AbLegacy.md.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#660