Hi Ceccon,
can you please give some more details about the instability of your ProviewR setup with the two Modbus TCP-Arduinos. What is the behavior of the stations (ProviewR runtime, Arduino)
1. I guess your ProviewR system does not stop working when one or both of the Modbus Arduinos fail? I only know one constellation, where the ProviewR plc process will crash, when a modbus tcp communication fails. But in this case you won’t see the behavior you described (works - works not – works).
2. In all other cases that I know (and I have some Arduino UNO/MEGA and ESP8266 modbus tcp systems running), the problem is related to the Arduino and the related sketches/libraries. A question is: can you ping the Arduinos, when the modbus slave stopped working? When yes, this means, your sketch is hanging (for what reason ever) and the problem is not related to ProviewR. I’ve never used the mudbus library, but instead the msgmodbus library from Marco Gerritse. With this library I’ve seen similar behavior as you described, on cable reinsertion or on start of the Arduino, when the peers network connection was down. I tried to find the reason, but without success.
At the end I changed to the Modbus/ModbusIP-library from André Sarmento Barbosa. I have to watch it for a while till I know whether it brings more stability. In general I must state, that the Ethernet Shields do not work with any switch without problems (as they normally should). So I had to look around to find switches, I could use with the Ethernet Shields.
The error counter does not really count errors (like hardware errors on the network), but counts the unsuccessful attempts to communicate with the modbus slave. Higher counter just means that the communication was lost earlier. After successful reconnection to the slave, the counter is set to zero again.
Kind Regards
Martin