[twincat] TwinCAT — Int64 fidelity for LINT/ULINT #341

Merged
dohertj2 merged 1 commits from auto/twincat/1.1 into auto/driver-gaps 2026-04-25 17:06:57 -04:00
Owner

Summary

Closes the silent Int32 truncation of LINT/ULINT in TwinCAT.

  • TwinCATDataType.ToDriverDataType()LInt → Int64, ULInt → UInt64. Two arms split out, "matches Int64 gap" truncation comment removed.
  • AdsTwinCATClient.MapToClrType already returned long/ulong and the value-coercion path (Convert.ToInt64/Convert.ToUInt64) was already correct, so no client changes were needed.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Tests110 / 110 passed (2 new asserts in DataType_mapping_covers_atomic_iec_types for LInt → Int64 and ULInt → UInt64)
  • Integration tests — hardware-gated (TWINCAT_TARGET_NETID)

🤖 Auto-generated by the Mode-B execution loop. Closes #305.

Closes #305

## Summary Closes the silent Int32 truncation of `LINT`/`ULINT` in TwinCAT. - `TwinCATDataType.ToDriverDataType()` — `LInt → Int64`, `ULInt → UInt64`. Two arms split out, "matches Int64 gap" truncation comment removed. - `AdsTwinCATClient.MapToClrType` already returned `long`/`ulong` and the value-coercion path (`Convert.ToInt64`/`Convert.ToUInt64`) was already correct, so no client changes were needed. ## Test plan - [x] `dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT` — clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Tests` — **110 / 110 passed** (2 new asserts in `DataType_mapping_covers_atomic_iec_types` for `LInt → Int64` and `ULInt → UInt64`) - [ ] Integration tests — hardware-gated (TWINCAT_TARGET_NETID) 🤖 Auto-generated by the Mode-B execution loop. Closes #305. Closes #305
dohertj2 added 1 commit 2026-04-25 17:06:53 -04:00
Map LInt/ULInt to DriverDataType.Int64/UInt64 instead of truncating
to Int32. AdsTwinCATClient.MapToClrType already returns long/ulong
so the wire-level read returns the correct boxed types.

Closes #305
dohertj2 merged commit 8286255ae5 into auto/driver-gaps 2026-04-25 17:06:57 -04:00
dohertj2 deleted branch auto/twincat/1.1 2026-04-25 17:06:57 -04:00
Sign in to join this conversation.