7a27ef1f67
v2-ci / unit-tests (push) Waiting to run
Claude-Session: https://claude.ai/code/session_01GT67AD99zQQqpLCVm3p7xk
196 lines
15 KiB
Markdown
196 lines
15 KiB
Markdown
# Heidenhain LSV2 live commissioning — 2026-11-11 (#829, #853)
|
||
|
||
.NET commissioning evidence for the read-only Heidenhain LSV2 driver (`Driver.Heidenhain`) against four
|
||
**production** Hermle iTNC 530 mills, through a deployed OtOpcUa server and OPC UA clients. Owner-approved scope:
|
||
read-only LSV2 only (INSPECT login with an empty password, plus the driver's default optional DNC login attempt and
|
||
its allowlisted reads), no writes to the controls, no DATA login, no controller configuration change, one
|
||
concurrent session per control, poll intervals at or above the driver defaults. Outages were simulated only by
|
||
stopping a local TCP proxy.
|
||
|
||
## Setup
|
||
|
||
| Item | Value |
|
||
|---|---|
|
||
| Server | docker-dev rig, image `otopcua-host:dev` built 2026-11-11 15:45 UTC from master (newest Heidenhain commit at build time: `ddc1f29e`, #839) |
|
||
| Node | SITE-B, `site-b-1` (OPC UA `opc.tcp://localhost:4844`). Its pair partner `site-b-2` was **stopped** for the run so each control had exactly one session (a warm standby acquires too) |
|
||
| Driver | `hh829`, DriverType `Heidenhain`, seeded straight into the ConfigDb, deployed with `POST /api/deployments` |
|
||
| Devices | `Hermle59`, `Hermle49`, `Hermle70`, `Hermle29`, each `host.docker.internal:190xx` → a socat proxy on the Mac → `<control>:19000` |
|
||
| Proxies | `socat -x TCP-LISTEN:<port>,bind=127.0.0.1,fork,max-children=1 TCP:<control>:19000`; `max-children=1` caps upstream sessions at one, `-x` hex-dumps every byte in both directions (the wire census below is parsed from those dumps) |
|
||
| Tags | 46 per control (184 total): the 35 fixed leaves — Controller, Status, Program, Overrides, Axes, Tool, Alarms and 11 Capabilities (timers left off) — plus 11 `ALARM:` conditions (`ALARM:*`, `ALARM:OTHER`, `ALARM:CLASS=1..9`, severity 700). Tag `DataType`s follow `HeidenhainTagRules`; AccessLevel `Read`. Deploy reported 184 authored, 0 skipped |
|
||
| Config, phase A (steps 1–3) | `TimeoutMs` 5000; Status/Custom/Slow/Alarm **15000 ms**; MaxAlarms 64; Telemetry on; DNC login on (driver default); DATA off; timers off; reconnect 1000–30000 ms |
|
||
| Config, phase B (step 4) | the driver defaults: Status 1000, Custom 1000, Slow 10000, Alarm 2000 ms (about 3 minutes) |
|
||
| Clients | `otopcua-cli` (`src/Client/ZB.MOM.WW.OtOpcUa.Client.CLI`) and python-opcua 0.98.13 (bulk typed reads and raw Write service calls) |
|
||
|
||
## Controls
|
||
|
||
Identity read through OPC UA; it matches the Java/Ignition evidence (`ignitionoee/docs/recipes/evidence/heidenhain-final-0.20.3-2026-11-03`).
|
||
|
||
| Control | Endpoint | Model / NC / PLC | Options |
|
||
|---|---|---|---|
|
||
| Hermle59 | 10.201.29.226:19000 | iTNC530 / 340490 04 SP10 / iC30v7.1_1 | `%0000111100000111` |
|
||
| Hermle49 | 10.201.29.225:19000 | iTNC530 / 340490 03 SP10 / iC30V6.1_2SP3 | `%0000111100000111` |
|
||
| Hermle70 | 10.201.22.225:19000 | iTNC530 / 606420 03 SP4 / iC22_V20.1_2SP2 | `%0000111100000111` |
|
||
| Hermle29 | 10.201.22.215:19000 | iTNC530 / 606420 03 SP4 / iC22_V20.1_2SP2 | `%0000111100000111` |
|
||
|
||
## Step 1 — browse and read through OPC UA
|
||
|
||
The raw tree browses as `ns=2;s=hh829/<Control>/<Folder>/<Leaf>`, and every condition carries its Part 9 children.
|
||
Every leaf advertises **AccessLevel = 1 and UserAccessLevel = 1** (CurrentRead only). Array leaves have ValueRank 1.
|
||
|
||
| Leaf group | Hermle59 | Hermle49 | Hermle70 | Hermle29 |
|
||
|---|---|---|---|---|
|
||
| Controller/* (4) | Good | Good | Good | Good |
|
||
| Status/ExecutionState, ProgramState | Good (1, 7) | Good (4, 7) | Good (4, 0) | Good (4, 0) |
|
||
| Program/Main, Current, Line | Good (Line 0) | Good (Line 0) | Good, running (Line 42255 and counting) | Good, running (Line 40474 and counting) |
|
||
| Overrides/* (R_RI 25) | BadUserAccessDenied | BadUserAccessDenied | BadUserAccessDenied | BadUserAccessDenied |
|
||
| Axes/Names | `X Y Z C a A` | `X Y Z C a A` | `X Y Z C a A` | `X Y Z C a A` |
|
||
| Axes/Positions | Good, 6 values | Good, 6 values | Good, 6 values, moving | Good, 6 values, moving |
|
||
| Tool/* (R_RI 51) | Good (tool 0) | **BadNotSupported** (all 5) | Good (T49, L 138.1506, R −0.0101) | Good (T17, L 138.303, R −0.0101) |
|
||
| Alarms/* | Good, Count 0 | Good, Count 0 | Good, Count 0, then 1 (below) | Good, Count 1 |
|
||
| Capabilities | DncLogin `AccessDenied`, Overrides `AccessDenied`, DataLogin/PlcLayout `Disabled`, the rest `Supported` | same, and Tool `Unsupported` | as Hermle59 | as Hermle59 |
|
||
|
||
Per control: 32 Good + 3 BadUserAccessDenied (Hermle49: 27 Good + 3 BadUserAccessDenied + 5 BadNotSupported).
|
||
This matches the LiveIntegration results and the Java evidence: R_RI 25 refused 23 (access denied) on all four,
|
||
R_RI 51 refused 24 (unsupported) on Hermle49, and the DNC login refused 23 on all four. INSPECT alone serves every
|
||
other selector.
|
||
|
||
### Defect found — Tool Number/Index/AxisCode are published as Double
|
||
|
||
`Tool/Number` (node DataType Int64) and `Tool/Index` / `Tool/AxisCode` (Int32) arrive at the client as a
|
||
**Double** variant (49.0, 0.0, 2.0) on every control that serves R_RI 51. Other integer leaves are correct
|
||
(`Program/Line` Int64, `Status/*` and `Alarms/Count` Int32). Cause: `HeidenhainSession.Leaf`, `case Lsv2Tool t`,
|
||
returns a switch expression whose arms are `long`, `int`, `int`, `double?`, `double?`. C# gives the expression the
|
||
type `double?`, so the integers are converted before boxing. The `Lsv2Program` arm next to it avoids this with an
|
||
`(object)` cast. `HeidenhainSessionTests.Tool_without_geometry_is_not_supported_not_zero` does not catch it:
|
||
Shouldly's `ShouldBe(7L)` treats a boxed `7.0` as equal. `otopcua-cli read` also hides it, because it prints `49`.
|
||
A strict client, or one that checks the variant type against the node's DataType, gets a type mismatch. Not fixed
|
||
here, per the run's read-only brief.
|
||
|
||
## Step 2 — OPC UA write attempts are refused; no write frame leaves the driver
|
||
|
||
| Attempt | Principal | Result |
|
||
|---|---|---|
|
||
| `otopcua-cli write` Controller/Model, Status/ExecutionState, Tool/Number × 4 controls | Anonymous and a temporary API key with all permissions on SITE-B | **BadNotWritable** (0x803B0000), all 24 |
|
||
| `otopcua-cli write` Overrides/Feed (all), Tool/Number (Hermle49) | both | the CLI's pre-write read fails (BadUserAccessDenied / BadNotSupported) and nothing is sent |
|
||
| Raw Write service (python): Overrides/Feed, Tool/Number, Axes/Positions, AlarmConditions/AnyAlarm/ActiveState × 4 controls | both | **BadNotWritable**, all 32 |
|
||
| Part 9 Acknowledge, Hermle29 AnyAlarm | API key | Good — applied **server-side only** (AckedState → Acknowledged) |
|
||
| Part 9 Acknowledge, Hermle29 Class7 | Anonymous | BadUserAccessDenied (AlarmAck gate) |
|
||
|
||
Unlike the Java run, where the anonymous access check rejected every write first, a principal that **holds write
|
||
permission** was refused here by the node's access level (BadNotWritable).
|
||
|
||
**Wire census.** The proxies' byte dumps, parsed frame by frame for the whole run (all sessions, both phases),
|
||
contain only `A_LG INSPECT`, `A_LG DNC` (each once per session, empty password), `R_VR`, `R_RI` 22/23/24/25/26/27/28/51.
|
||
There were **no** non-allowlisted commands and no `R_MB`, `R_DP` or `C_*` frames. In the write and acknowledge
|
||
window (17:00:45–17:02:20 UTC), each control received only its regular poll reads (`R_VR`, `R_RI` 22–28/51).
|
||
Client→control bytes for the whole run: Hermle59 12 876, Hermle49 12 746, Hermle70 13 396, Hermle29 15 526.
|
||
|
||
## Step 3 — outage and recovery (Hermle59 proxy)
|
||
|
||
An OPC UA read loop sampled once a second: every value leaf of all four controls (35 each), plus each control's
|
||
AnyAlarm condition Quality.
|
||
|
||
| Event (UTC) | Hermle59 | Others |
|
||
|---|---|---|
|
||
| Before the stop | 32 Good + 3 BadUserAccessDenied | unchanged |
|
||
| 17:06:02.6 proxy stopped | — | — |
|
||
| 17:06:05 (next poll, +2.4 s) | **all 24 remote leaves BadNoCommunication**; the 11 Capabilities leaves read `CommunicationLost`; AnyAlarm Quality BadNoCommunication; log: `LSV2 communication lost; reconnecting with backoff`, `alarm list unavailable (CommunicationLost); its 11 alarm condition(s) keep their state` | unchanged, Good |
|
||
| 17:06:06–12 | reconnects back off (connection refused at 1, 2, 4… s) | unchanged |
|
||
| 17:06:15.8 proxy restarted | — | — |
|
||
| 17:06:20 reconnect (backoff) → 17:06:22 | **all Good again** (~6 s after the proxy came back); `alarm list readable again` | unchanged |
|
||
|
||
Across 327 of 328 samples, Hermle49, Hermle70 and Hermle29 kept their exact status mix. The one exception was the
|
||
17:10:31 phase-B redeploy, which respawned the whole driver. The driver's health read `Degraded` with the connect
|
||
error while Hermle59 was down. Detection is bounded by the next poll of that control (Status interval + TimeoutMs).
|
||
A second, unplanned leg (below) also showed that a control unreachable at driver start retries and recovers: from
|
||
17:04:04 to 17:05:34 Hermle59's leaves were BadNoCommunication with `CommunicationLost` capabilities, and they were
|
||
all Good about 1 s after the reconnect at 17:05:35.
|
||
|
||
## Step 4 — load at default intervals
|
||
|
||
The proxy byte dumps give these per-control figures (RTT = request → reply). The channel is one transaction at a
|
||
time.
|
||
|
||
| Phase | Control | Requests/s | Bytes/s out / in | RTT median / p95 / max (ms) | Channel busy |
|
||
|---|---|---|---|---|---|
|
||
| A (all 15 s), 180 s | Hermle59 | 0.53 | 5.2 / 16.4 | 50 / 133 / 175 | — (one ~0.5 s batch per 15 s) |
|
||
| | Hermle49 | 0.47 | 4.5 / 14.5 | 48 / 134 / 159 | |
|
||
| | Hermle70 | 0.53 | 5.2 / 18.5 | 47 / 135 / 170 | |
|
||
| | Hermle29 | 0.67 | 6.5 / 27.5 | 50 / 137 / 160 | (batch ≈ 0.67–0.83 s) |
|
||
| B (defaults 1/1/10/2 s), 180 s | Hermle59 | 4.78 | 47.6 / 148.5 | 50 / 133 / 396 | 30.3 % |
|
||
| | Hermle49 | 4.68 | 46.6 / 145.6 | 48 / 135 / 474 | 28.6 % |
|
||
| | Hermle70 | 4.78 | 47.6 / 176.3 | 47 / 132 / 244 | 28.1 % |
|
||
| | Hermle29 | 5.38 | 53.6 / 216.3 | 48 / 128 / 244 | 32.1 % |
|
||
|
||
Request mix at the defaults over 180 s, per control: R_RI 22/23/24/26 179 each (the 1 s status group keeps up),
|
||
R_VR 18 and R_RI 51 18 (10 s slow group), and **R_RI 27 108**, which is 90 alarm walks (2 s) plus 18 slow-group
|
||
walks. R_RI 28 also ran 108 times on Hermle29, the control with an active alarm. R_RI 25, and R_RI 51 on Hermle49,
|
||
were sent **once per session** and then suppressed as documented. No control slowed down or refused anything new
|
||
under either cadence.
|
||
|
||
Observation, not a defect: when a control carries `ALARM:` tags **and** the `Alarms/*` arrays, the alarm walk runs
|
||
twice — once per `AlarmMs` for the conditions and again in the Slow group for the arrays. The two are separate reads,
|
||
not shared. At the defaults that is about 0.1 extra R_RI 27 per second per control.
|
||
|
||
## #853 — alarm class/group → Part 9 condition class
|
||
|
||
Every alarm seen during the run (about 16 minutes of walks on all four controls). None were provoked.
|
||
|
||
| Control | Wire record (`S_RI 27`) | Class | Group | Number (int32 / hex) | Text | Driver's condition class |
|
||
|---|---|---|---|---|---|---|
|
||
| Hermle29 | `0007 0003 8100017b …` | 7 Info | 3 Plc | −2130706053 / `0x8100017B` | `702126 Filter wait for spindle cooling (U02) E161` | `BaseConditionClass` (i=11163) |
|
||
| Hermle70 (raised 17:01:47, cleared before 17:13) | `0007 0003 8100015e …` | 7 Info | 3 Plc | −2130706082 / `0x8100015E` | `701550 Cabin unlocked! B301` | `BaseConditionClass` (i=11163) |
|
||
| Hermle59, Hermle49 | — (R_RI 27 → T_ER 57, empty list throughout) | | | | | |
|
||
|
||
- Both conditions behaved as designed. `AnyAlarm` and `Class7` went Active, severity 700, Quality Good, with the
|
||
message `<number> <text> (class 7, group 3)`. The `OtherAlarms` and other class conditions stayed Inactive.
|
||
Hermle70's alarm raised live, mid-run.
|
||
- **Consistent with the mapping table.** Group 3 (`Plc`) maps to Base. Both texts are machine-builder (Hermle) PLC
|
||
messages: a 70xxxx message number and a device tag (`E161`, `B301`). That fits the RemoTools `DNC_ERROR_GROUP`
|
||
numbering, where 3 = PLC. Class 7 = Info fits non-fatal status notices, and the one record captured earlier
|
||
(−1 "Run test of cutout channels", class 7 / group 4) is consistent too. The live data now corroborates
|
||
**class 7, group 3 and group 4**.
|
||
- **Still unobserved on hardware:** classes 1–6, 8 and 9 (including 5 EmergencyStop → Safety) and groups 1, 2, 5
|
||
and 6 (the Process/System/Python rows). Confirming them would need an active alarm of those kinds, which this run
|
||
did not provoke.
|
||
- Note for authors: on these controls the alarm **number** field is not the displayed message number. It reads as
|
||
`0x81xxxxxx`, which is negative as int32, and the HMI number is the leading digits of the text. A `NUMBER=` selector
|
||
therefore has to use the negative raw value. This is documented ("filter on the raw codes"), but worth knowing.
|
||
|
||
## Incidental findings (outside the Heidenhain driver)
|
||
|
||
1. **Operator error during the run, now recovered.** When the first outage leg stopped the Hermle59 proxy,
|
||
`kill $(lsof -ti tcp:19059)` also matched and killed OrbStack's networking helper, which held the forwarded
|
||
connection. The OrbStack VM stopped; every container restarted when `orbctl start` was run (17:03–17:04 UTC), and
|
||
`otopcua-dev-sql-1` / `otopcua-dev-traefik-1` were started by hand. The outage leg was then re-run cleanly by
|
||
killing only the socat processes. **After this restart the OrbStack containers can no longer reach the LAN host
|
||
10.100.0.35** (the driver fixtures and opc-plc). The Mac itself, internet access and the 10.201.x VPN still work.
|
||
Before 17:03 there were no such errors. This most likely needs OrbStack restarted from the app, or its macOS
|
||
Local Network permission re-granted.
|
||
2. **ConfigPublishCoordinator does not survive a ConfigDb that is unreachable at singleton start.**
|
||
`ConfigPublishCoordinator.PreStart` queries the DB synchronously. With SQL still starting, it threw
|
||
`ActorInitializationException` (SqlException: name not resolved), the singleton was terminated
|
||
(`Singleton actor [akka://otopcua/user/config-publish/config-publish] was terminated`) and it never restarted.
|
||
Every deploy then waited forever (`ClusterSingletonProxy failed to find … [config-publish]` every 30 s). Restarting
|
||
central-1 moved the singleton to central-2, which recovered it. This is a real resilience defect for any host that
|
||
boots before its ConfigDb.
|
||
3. The first deployment (`7a47a745`) ended `TimedOut` (5/6 acks) because `site-b-2` was stopped. The later deploys
|
||
set `ClusterNode.MaintenanceMode = 1` on `site-b-2` and sealed. The flag was reset to 0 afterwards.
|
||
|
||
## Cleanup
|
||
|
||
The `hh829` driver, its 4 devices, 36 tag groups and 184 tags were deleted, along with the temporary API key and
|
||
SITE-B NodeAcl. Deployment `6c7f859f` sealed at 17:14:13, and the driver was stopped and disposed on `site-b-1` at the
|
||
same moment. All four proxy sessions closed, and then the proxies were stopped. `site-b-2` was restarted (standby,
|
||
no Heidenhain driver), and `site-b-2` MaintenanceMode was restored to 0. Nothing on the controls was changed.
|
||
|
||
## Status against the gates
|
||
|
||
- **#829:** browse/read, write refusal (including a write-capable principal), outage and recovery with the other
|
||
controls unaffected, bounded traffic at default intervals, and retained evidence are **done** on four iTNC 530
|
||
controls. **Open:** the Tool Number/Index/AxisCode Double-variant defect above, which should be fixed and
|
||
re-verified with a strict variant-type assertion. Still unproven as before: other control families
|
||
(TNC 320/430/640), successful `R_MB`, units, timers 30–34, and DATA (not exercised under this scope).
|
||
- **#853:** partially confirmed — class 7, groups 3 and 4 match the RemoTools numbering and map as documented
|
||
(Base). Classes other than 7 (notably 5 → Safety) and groups 1/2/5/6 are not yet observed on hardware.
|