CODESYS Modbus TCP master&slave in same device

I have the following topology where WAGO Basic Controllers are configured as Modbus TCP Master and Slave functionality. Controllers M3 and M4 read/write data from Modbus TCP couplers. There, M3 and M4 are Modbus TCP masters. M05 reads/writes data from M3 and M4. There M3 and M4 are configured as Modbus TCP slaves. Then finally M05 is configured as Modbus TCP Slave to control room automation system.

If this implementation is done with CODESYS built-in Modbus configurator, it seems that if M3 or M4 reboots, M05 losts its’ connection to a slave device M3/M4 and can’t recover without Reset Warm. Is this something that can be fixed by changing configuration? Does anyone have experience about using WAGO Basic Controllers (or similar setup with CC100, PFC200) as Master and Slave at the same time?

A screenshot about communication OK state (control room is disconnected):

Is Auto-reconnect enabled on the modbus tcp master?

Hi VegardS,

Yes, I have enabled Auto-reconnect. This is disabled by default. I have enabled it to all Masters. Wireshark shows that communication stops to TVP retransmission with M3 (rebooted controller) while communication from M05 to M4 continues normally. These are the last rows from wireshark trace with 502 filter where the controller M3 is rebooted. M05 is IP and M3 is IP