The IODD data type TimeSpanT is mapped to the OPC UA DataType Duration.
The IODD data type TimeSpanT consists of 8 bytes representing fractions of a second (seconds). See IODD Specification for more details.
The OPC UA DataType Duration consists of a Double variable representing the number of milliseconds. Fractions can be used to represent fractions of milliseconds. See OPC 10000-3 for more details.
The following rules for conversion apply. Implementers shall ensure that the time span value mappings are done as exactly as possible.
As the range of the OPC UA Duration values is bigger than the IO-Link TimeSpanT value, the following conversion formula can be applied without restrictions:
If the OPC UA Duration value is bigger than the maximum IO-Link TimeSpanT value () converted to milliseconds (), the IO-Link TimeSpanT value has to be the maximum value for 64-bit unsigned integer 0xFFFFFFFFFFFFFFFF.
If the OPC UA Duration value fits into this range, the following conversion formula shall be applied: