Heidenhain: Tool/Number, Tool/Index and Tool/AxisCode published as Double instead of Int64/Int32 #867

Closed
opened 2026-11-11 12:18:10 -05:00 by dohertj2 · 1 comment
Owner

Found by the #829 live gate on 2026-11-11 against four real iTNC 530 controls. In HeidenhainSession.Leaf, the case Lsv2Tool t switch arms mix long, int and double?. C# unifies them to double?, so OPC UA clients receive Double values on nodes that advertise Int64/Int32. The neighbouring Program case avoids this with an (object) cast.

The unit test Tool_without_geometry_is_not_supported_not_zero doesn't catch it, because Shouldly treats 7.0 as equal to 7L, and otopcua-cli prints 49 either way.

Fix: cast to object per arm, and add a test that asserts the runtime type of the value. Recheck live (read-only).

Found by the #829 live gate on 2026-11-11 against four real iTNC 530 controls. In `HeidenhainSession.Leaf`, the `case Lsv2Tool t` switch arms mix `long`, `int` and `double?`. C# unifies them to `double?`, so OPC UA clients receive Double values on nodes that advertise Int64/Int32. The neighbouring Program case avoids this with an `(object)` cast. The unit test `Tool_without_geometry_is_not_supported_not_zero` doesn't catch it, because Shouldly treats 7.0 as equal to 7L, and `otopcua-cli` prints 49 either way. **Fix:** cast to object per arm, and add a test that asserts the runtime type of the value. Recheck live (read-only).
dohertj2 added the priority:p2type:bug labels 2026-11-11 12:18:11 -05:00
Author
Owner

Done. Tool/Number is Int64 and Tool/Index and Tool/AxisCode are Int32. A runtime-type test now covers every leaf, and a new live test was verified read-only on Hermle59 and Hermle70. Pushed to master in e857135e..7a27ef1f; full suite green (20 projects, 0 failures, 0 warnings).

Done. Tool/Number is Int64 and Tool/Index and Tool/AxisCode are Int32. A runtime-type test now covers every leaf, and a new live test was verified read-only on Hermle59 and Hermle70. Pushed to master in `e857135e..7a27ef1f`; full suite green (20 projects, 0 failures, 0 warnings).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#867