I have a program in Simulink to send some values through TCP-IP and to read them in Python 2.7. The data is sent as "single" values. The code in Python reads that as 4 strings as its 32 bits long (string of length 4).
print "x0:", ord(data[0])
print "x1:", ord(data[1])
print "x2:", ord(data[2])
print "x3:", ord(data[3])
The problem is, I get some different values in Python than that being sent.
0.125 is read as x0: 62, x1: 0, x2: 0, x3: 0
13.65 is read as x0:65, x1=90, x2: 96, x3: 0
51.79 is read as x0:66, x1=79, x2: 42, x3: 128
113.4 is read as x0:66, x1=226, x2: 200, x3: 220
So how to get these values... 0.125, 13.65, 51.79, 113.4, ... as proper numbers on the receive side (Python)?