pyhys/minimalmodbus

Possible bug in ._num_to_two_bytes function

Closed this issue · 1 comments

Hi team

Somewhat dumbfounded by the results for 5897 and 5898. UINT16s

5897 should be 0x1709 and 5898 0x170A?

Version: 2.1.1

>>> minimalmodbus._num_to_two_bytes(5896)
b'\x17\x08'
>>> minimalmodbus._num_to_two_bytes(5897)
b'\x17\t'
>>> minimalmodbus._num_to_two_bytes(5898)
b'\x17\n'
>>> minimalmodbus._num_to_two_bytes(5899)
b'\x17\x0b'
>>> 

Not bug. My bad. Python returns asci for 09 and 10.