[twincat] TwinCAT — Native UA TIME/DATE/DT/TOD #342
Reference in New Issue
Block a user
Delete Branch "auto/twincat/1.2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
IEC TIME/DATE/DT/TOD now surface as native OPC UA types instead of raw
UDINT.Core.Abstractions/DriverDataType.cs— newDurationmember (back-compat: sibling driver switches fall through toBaseDataTypedefault).Server/DriverNodeManager.cs—Durationmapped to OPC UADataTypeIds.Duration.TwinCATDataType.ToDriverDataType():Time/TimeOfDay→DurationDate/DateAndTime→DateTimeInt32)AdsTwinCATClient.cs— newPostProcessIecTimeconverts raw UDINT after the wire read:TimeSpanDateTimeReadValueAsyncandOnAdsNotificationEx.ConvertForWritenow acceptsTimeSpan/double/DateTimefor these types viaDurationToUDIntandDateTimeToUDInt. Range-checks reject pre-1970 and post-2106 DT values.Test plan
dotnet build— TwinCAT, Core.Abstractions, S7, AbCip, Modbus all clean. (Pre-existingDriverSubscriptionBridge.cscref ambiguity in Server is unrelated — reproduces on HEAD without these changes.)dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Tests— 120 / 120 passed (11 new: TIME→TimeSpan, TOD→TimeSpan, DT→DateTime UTC, DATE→midnight UTC, passthrough for non-time types, write conversions for TimeSpan/double/DateTime, round-trip, pre-epoch rejection)🤖 Auto-generated by the Mode-B execution loop. Closes #306.
Closes #306