How to read 64bit data from modbus reciving 2 registers with dint ?
Hello i need to recive unix timestamp (1554957709) over modbus which are stored in 2 registers dint datatype, how can i convert this in controller?
Answers
Hello,
I assume the first Dint of Unix timestamp holds number of second since 1 January 1990. The second Dint likely gives fraction of second.
On the other hand it is possible that number of seconds is split into two 16-bit numbers sent through two Dints. In this case just multiply higher dint by 65536 and add lower dint.
I assume the first Dint of Unix timestamp holds number of second since 1 January 1990. The second Dint likely gives fraction of second.
On the other hand it is possible that number of seconds is split into two 16-bit numbers sent through two Dints. In this case just multiply higher dint by 65536 and add lower dint.
Add new comment