I have the following Modbus response:16736 I can convert it to hex and binary: hex: 0x41600000 binary: 0b100000101100000
I should convert Modbus reponse to float, and the result should be 14.0. If I go to http://gregstoll.dyndns.org/~gregstoll/floattohex/ , 0x41600000 converts to 14.0.
I have tried all sorts of struct.unpack kung-fu, but I cannot get 14.0. (I heave read all of the Stackoverflow posts that I could find before I decided to post yet another conversion question, but I definitely don't understand how this works)
What am I missing? Thanks a lot.
repr(response)to show us what exactly you have. At least then we could have advised you on converting from a literal hex representation to bytes too.