codesystart - 2022-01-21

Hello,

we are trying to use the new OPC UA library example project.

In this project, the timestamp which is provided by the OPC server in the LINT or OpcUa_DateTime
Later it is converted in to codesys datatype DT using a function DateTimeToDT.

In the implementation of this fuunction some EPOCH constants (11644473600) with datatype LINT is used. This is equivalent to Sunday, January 1, 2339 12:00:00 AM.

But this function only gives timestamps in seconds.

the problem is we want it in milliseconds. we tried to use TO_TOD or TO_TIME. but that gives incorrect results.

could somebody let me know how do we solve this problem??