Have you implemented a reconnect delay?
If a device disconnects for any reason, wait 1 second or more for things to settle before attempting a reconnect.
The issue probably has more to do with your slave devices being slow to accept another connection attempt.
You restarting the application provides this delay.
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.