I have an issue with how an interface is reading the data i send it.
what i want to do is send the interface the current time. However the interface uses two's compliment so when i do this:
Time = time.time()
timer = struct.pack('<d', Time)
The interface receieves a binary number similar to this 1010010111111000011111000010111 and since it used twos compliment it gets the time totally wrong. It gets a negative number and seems to think its 1942.
My question is how do I convert Time to binary then pack the front of the binary number with 0s so it is 8bytes long, so i can then pack it and send it to my interface.
Like the docs say,
d
is for 8-byte floats. 8-byte integers useQ
orq
.