HEX/Decimal to date and time from modbus

T

Thread Starter

Thomas Nissen

Hi,

I have a modbus connection to a ventilation system where it generates alarms when something is wrong. I can with modbus receive data about the alarm. That part is documented with a register for ID, date and time. All tre receives contains 2 byte of data. ID 00:13 (witch is converted to decimal error code 19 = Filter alarm)

But i cannot figure out what format the date and time are in. However i can at the ventilation system see what these dates and times are translated to at the display.

The date i received in bytes (hex) = 43:68 (17256 in decimal) and that's equal on the display with "13-11-08" (08-nov-2013) and the time in bytes (hex) = 34:71 (13425 in decimal) that equals on the display "06:35"

I tried to compare with epoch "1970 and 1980" and tried comparing with other time translations 32bit integer and so on. But i cannot figure out what the translate is to. Maybe someone here have seen similar and can tell maybe what encoding this is.

Best Regards Thomas Nissen
 
L

Lynn August Linse

I agree with Bob - ask for the info (or a refund).

There are 86,400 seconds in a day, so it's not possible to pack the 'time' in seconds since mid-night into a 16-bit int. There would need to be a formula.

I'd not even try to guess how someone encodes years into a 16-bit. Likely is number of days since some date, but could be the product CEO's kid's birthday for all you know :).
 
Top