@@ -185,6 +185,47 @@ Options to eliminate the manual step:
|
||||
the rotation permanently, worth it if the integration host is
|
||||
long-lived.
|
||||
|
||||
## Online-change test scenario
|
||||
|
||||
PR 2.3 (proactive Symbol-Version invalidation listener) ships an
|
||||
operator-gated integration test
|
||||
(`TwinCATSymbolVersionTests.Driver_invalidates_handle_cache_on_symbol_version_bump`)
|
||||
that verifies `AdsTwinCATClient`'s `AdsSymbolVersionChanged` listener
|
||||
wipes the handle cache when the PLC re-initialises after an online
|
||||
change. The test polls for up to 60 s waiting for the operator to
|
||||
trigger the change from XAE.
|
||||
|
||||
The fixture state (`GVL_Perf` + `aTags[1..1000]`) is the same one used by
|
||||
the Sum-read perf test — no new project state required.
|
||||
|
||||
### Manual workflow
|
||||
|
||||
With the XAR runtime live + the test process polling:
|
||||
|
||||
1. **Open the project in XAE** on the dev box (or wherever XAE runs).
|
||||
2. **Add a dummy variable to `GVL_Perf`** — any new declaration triggers
|
||||
a symbol-table rebuild. Example: append
|
||||
`bSymVerProbe : BOOL := FALSE;` to the GVL.
|
||||
3. **Login** (`Ctrl+F8`) — XAE prompts to load the change.
|
||||
4. **Activate Configuration** (Yellow-arrow button, or `TwinCAT → Activate Configuration`).
|
||||
The runtime re-initialises; the symbol-version counter increments;
|
||||
`AdsTwinCATClient.OnAdsSymbolVersionChanged` fires; the handle cache
|
||||
wipes; the test polls observe `SymbolVersionBumps > 0` + asserts the
|
||||
post-bump read recreates handles.
|
||||
|
||||
The test skips by default — opt in by setting
|
||||
`TWINCAT_MANUAL_ONLINE_CHANGE=1` alongside the standard
|
||||
`TWINCAT_TARGET_HOST` / `TWINCAT_TARGET_NETID` env vars before kicking
|
||||
off the test run.
|
||||
|
||||
```powershell
|
||||
$env:TWINCAT_TARGET_HOST = '10.0.0.42'
|
||||
$env:TWINCAT_TARGET_NETID = '5.23.91.23.1.1'
|
||||
$env:TWINCAT_MANUAL_ONLINE_CHANGE = '1'
|
||||
dotnet test tests\ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.IntegrationTests `
|
||||
--filter "FullyQualifiedName~TwinCATSymbolVersionTests"
|
||||
```
|
||||
|
||||
## How to run the TwinCAT-tier tests
|
||||
|
||||
On the dev box:
|
||||
|
||||
Reference in New Issue
Block a user