Modbus TCP slave cannot reconnect after disconnection
Posted: Wed Oct 07, 2020 5:15 pm
Hi Benj!
I try to find a way to restart modbus comms after saden disconnect (unplug cable) either from slave or master..
At the moment I can sense the disconnection using the "Get socket status" function, if it is anything other than 23 decimal then I trigger a function to
reconnect, but nothing I used after this worked. Best results I had from playing around was only to reconnect but have no comms.
Comms resume only after I reset the microcontroller.
my flowchart is messy as you can see from the disabled functions...
any suggestions?
George
I try to find a way to restart modbus comms after saden disconnect (unplug cable) either from slave or master..
At the moment I can sense the disconnection using the "Get socket status" function, if it is anything other than 23 decimal then I trigger a function to
reconnect, but nothing I used after this worked. Best results I had from playing around was only to reconnect but have no comms.
Comms resume only after I reset the microcontroller.
my flowchart is messy as you can see from the disabled functions...
any suggestions?
George