Hi community, I am currently experiencing a modbus timeout error (Error 66) using a state machine. I have experimented different types of timeout (10000 ms, 5000 ms, 10000000 ms) and it would work for several iterations of the state machine, and then after would time out. Is there any sort of way to reset to avoid this timeout by restarting the Modbus TCP master for each iteration, so that it would not time out? It happens on 172.22.11.12. Possibly it has something to do with how long the for loop takes?
Solved! Go to Solution.
Replace your tunnel for the Modbus reference with a shift register. In addition, you should always use a shift register for references wired into and through For loops. If the loop doesn't execute, you will pass out an invalid reference when using basic tunnels.
Error 66 is not a timeout, but rather an indication that the connection was closed by the peer (the device that you are communicating with). If that is the case, you will need to find out why that device is closing the connection. If this is the normal behavior for the device, you may need to open/close the connection every time you communicate with the device.
It's interesting because whenever I use a VI that just uses Modbus blocks, I am not producing error 66 and the communication is perfect. However, when using the VI included in my original message the modbus will only work for a specific period of time and then timeout. Is this because my VI is running at full speed and is too fast for the Modbus? I checked if I lost communication, and I have not. The VI in the picture is the one that is working correctly.