Auto: twincat-4.1 — nested UDT browse via online type walker

Closes #315
This commit is contained in:
Joseph Doherty
2026-04-26 07:28:52 -04:00
parent da6e19d07d
commit 0444cb699d
15 changed files with 1067 additions and 19 deletions

View File

@@ -198,6 +198,45 @@ Options to eliminate the manual step:
the rotation permanently, worth it if the integration host is
long-lived.
## Complex hierarchy
PR 4.1 / #315 (nested-UDT browse via online type walker) exercises
`TwinCATTypeWalker.Walk` against a real PLC symbol graph. The fixture
state required:
### DUTs
- `PLC/DUTs/ST_NestedFlags.TcDUT` — mixed-atomic struct (BOOL / INT / REAL /
STRING) used for the per-member flatten coverage.
- `PLC/DUTs/ST_AlarmRecord.TcDUT` — small two-field struct used as the
element type of the cutoff array.
- `PLC/DUTs/ST_RecursiveCap.TcDUT` — struct with a `POINTER TO`
self-reference; verifies the walker's pointer-skip + cycle-guard
paths terminate without exploding the symbol stream.
### GVL: `GVL_Plant`
```st
VAR_GLOBAL
stFlags : ST_NestedFlags;
aAlarmRecords : ARRAY[1..2000] OF ST_AlarmRecord;
END_VAR
```
`stFlags` produces N atomic leaves where N = the number of `ST_NestedFlags`
fields. `aAlarmRecords` has 2000 elements which exceeds the default
`TwinCATDriverOptions.MaxArrayExpansion` (1024) — discovery surfaces it as
a single `IsArrayRoot` leaf rather than 4000 per-element rows. Lower the
cap on the driver instance to force per-element expansion (or raise it if
the operator wants the per-element view).
The XAE-form artefacts ship at `PLC/DUTs/*.TcDUT` + `PLC/GVLs/GVL_Plant.TcGVL`;
import them into the PLC project alongside `GVL_Fixture` + `GVL_Perf`.
The integration test that exercises this fixture lives at
`tests/.../TwinCATUdtBrowseTests.cs` and skips via `[TwinCATFact]` when
the XAR runtime isn't reachable.
## Online-change test scenario
PR 2.3 (proactive Symbol-Version invalidation listener) ships an