EasyModbusTCP.PY icon indicating copy to clipboard operation
EasyModbusTCP.PY copied to clipboard

tcp connection issue

Open tronar opened this issue 7 years ago • 0 comments

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.

tronar avatar Jul 13 '18 16:07 tronar