EasyModbusTCP.PY
EasyModbusTCP.PY copied to clipboard
tcp connection issue
Hi, I've just downloaded the code and was having some problems: myList.append((data[i2+3+6]<<8) +data[i2+4+6]) IndexError: index out of range
After doing some debugging, it turns out that my device is returning the data in two packets, and your code is assuming it is always only one. I added the MSG_WAITALL option to recv()s and it seems to hold.