TwinCAT: hardware-gated items #310/#314 from driver-gaps backlog #645

Closed
opened 2026-10-08 16:33:49 -04:00 by dohertj2 · 2 comments
Owner

Split out of #637. Items #310 and #314 need real TwinCAT hardware to implement and verify.

Split out of #637. Items #310 and #314 need real TwinCAT hardware to implement and verify.
dohertj2 added the driver/twincat label 2026-10-08 16:33:49 -04:00
Author
Owner

#310 and #314 ported, offline (af19db4e → 802781b6, merged 46bf939f, opus-reviewed twice). ADS sum-read is opt-in (useSumRead, default off; sumReadMaxItems 1–500 + a 32 KiB byte budget per command); only scalars passing the strict width/kind check ride a batch (review caught mismatched-type tags decoding garbage at Good); overall 1793/1794 latch the device to single reads until re-init, any other non-comms code reads that chunk singly for the poll with a once-per-device Warning. Diagnostics (AdsState, AppName, OnlineChangeCnt, CycleTimeMs, LastExecTimeMs, HeadroomMs) go to /hosts via IDriverDiagnostics, opt-in diagnosticsEnabled (default off), reusing the probe's ReadState. TwinCAT.Tests 355/355.

Live gate deferred: the Elma presses are reachable over the VPN, but the ADS routes ignitionoee left point at the Mac's old VPN IP (10.181.198.189 → now 10.181.207.140), and adding a route changes a production PLC's route table — waiting on an explicit OK (candidate: Z35474, the one TC3 press, port 851).

#310 and #314 ported, offline (`af19db4e` → `802781b6`, merged `46bf939f`, opus-reviewed twice). ADS sum-read is opt-in (`useSumRead`, default off; `sumReadMaxItems` 1–500 + a 32 KiB byte budget per command); only scalars passing the strict width/kind check ride a batch (review caught mismatched-type tags decoding garbage at Good); overall 1793/1794 latch the device to single reads until re-init, any other non-comms code reads that chunk singly for the poll with a once-per-device Warning. Diagnostics (AdsState, AppName, OnlineChangeCnt, CycleTimeMs, LastExecTimeMs, HeadroomMs) go to /hosts via IDriverDiagnostics, opt-in `diagnosticsEnabled` (default off), reusing the probe's ReadState. TwinCAT.Tests 355/355. **Live gate deferred:** the Elma presses are reachable over the VPN, but the ADS routes ignitionoee left point at the Mac's old VPN IP (10.181.198.189 → now 10.181.207.140), and adding a route changes a production PLC's route table — waiting on an explicit OK (candidate: Z35474, the one TC3 press, port 851).
Author
Owner

Live-gated on real presses and closing (master ec375538). Read-only: no ADS writes other than the user-approved route maintenance.

Presses: Z35474 (TC3, port 851) and Z34834 (TC2 2.11, port 801).

  • #310 sum-read had never worked on hardware. Beckhoff's SumRead ctor throws InvalidCastException for a List<> of entries (it needs an array), so every batched tag read BadCommunicationError on every poll with no log line. The fake client in the unit tests never built a real SumRead. Fixed in AdsTwinCATClient.CreateSumRead + a construction test that fails without the fix; a once-per-device Warning now fires on a sum-chunk failure (only after a successful connect). (664ff75e, a92fb81f)
  • After the fix: 59 real symbols on both presses, chunk sizes 8 and 200, status identical to single reads everywhere; values identical except live axis positions. Poll ~0.35–0.66 s vs ~2.7 s singly. TC2 2.11 serves sum-read without falling back.
  • #314 diagnostics: TC3 shows all six (cycle 5.0 ms, exec 0.1 ms). TC2 has none of the TC3 system symbols — added a fallback to the TC2 equivalents; TC2 now shows all six (cycle 20.0 ms, exec 0.6 ms). TC2 costs 8 reads on the first tick / after reconnect, then ≤ 4. Exercised through a driver harness; the /hosts leg on docker-dev cannot run because the host has no in-process AMS router.
  • Sum-write remains not ported.
Live-gated on real presses and closing (master `ec375538`). Read-only: no ADS writes other than the user-approved route maintenance. Presses: Z35474 (TC3, port 851) and Z34834 (TC2 2.11, port 801). - **#310 sum-read had never worked on hardware.** Beckhoff's `SumRead` ctor throws `InvalidCastException` for a `List<>` of entries (it needs an array), so every batched tag read `BadCommunicationError` on every poll with no log line. The fake client in the unit tests never built a real `SumRead`. Fixed in `AdsTwinCATClient.CreateSumRead` + a construction test that fails without the fix; a once-per-device Warning now fires on a sum-chunk failure (only after a successful connect). (`664ff75e`, `a92fb81f`) - After the fix: 59 real symbols on both presses, chunk sizes 8 and 200, status identical to single reads everywhere; values identical except live axis positions. Poll ~0.35–0.66 s vs ~2.7 s singly. TC2 2.11 serves sum-read without falling back. - **#314 diagnostics:** TC3 shows all six (cycle 5.0 ms, exec 0.1 ms). TC2 has none of the TC3 system symbols — added a fallback to the TC2 equivalents; TC2 now shows all six (cycle 20.0 ms, exec 0.6 ms). TC2 costs 8 reads on the first tick / after reconnect, then ≤ 4. Exercised through a driver harness; the `/hosts` leg on docker-dev cannot run because the host has no in-process AMS router. - Sum-write remains not ported.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#645