First of all, since this is my first post, I want to thank everyone in this forum for the effort and time, sharing their projects as well as the support to people all around the world to build new devices and learn new skills.
In the specific issue that I am facing, I am using arduino mega together with the ethernet shield w5500 in order to control a stepper motor through an external plc. For the communication between the arduino and the plc I want to use Modbus TCP/IP.
The problem that I am facing is that when I connect the Arduino to my ethernet network, although in the beggining I can read and write variables after a while the communication is blocked and I can’t reach it anymore. Not even to ping its IP on the network. If I redownload the sketch then it works again for a while until it’s blocked again.
I attach here my sketch. Any ideas for the cause of the problem?
modbus_n2_gen_valve_V3_mega.ino (2.89 KB)