Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
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??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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??