ljean / modbus-tk

Create Modbus app easily with Python
Other
557 stars 211 forks source link

how to use the utils.calculate_crc() #177

Open huanhuangongzi opened 1 year ago

huanhuangongzi commented 1 year ago

may be in this way: utils.calculate_crc((1, 2, 0, 1)),but the result is not correct.

enev13 commented 1 year ago

It is correct but the bytes are swapped. With the input you provide the function returns 0x61D8. If you use some online tool it returns 0xD861.