Modbus Tcp Communication Recovery


Jonessy

Recommended Posts

Hello Forum,

 

I am testing how to recover from a communication breakdown and I wonder what would be a right way to get communication going on again?

 

I unplug ethernet cable and get those timeout messages, plug it back and then do InitComm() from a sequence but it does not work every time, actually works very seldom?  I have to press button to start sequence some 10 to 20 times before it works.  If I don't press button comms won't get back at all.  Looks like that if there has been longer time timeouts like few minutes InitComm() seems to work at once, but just after cable plugged back it takes several presses.

 

I have DF 5.90 on win8 PC with remote I/O and there is no possibility to program handshaking with a bit so I think I have to use OnAlert() but haven't tried it yet.

 

How should InitComm() be used?

 

Thanks in advance!

 

 

Link to comment
Share on other sites

Unless you have a static IP, it takes windows 10 seconds or more to retrieve a DHCP address from your router, so the network may not be available right away.

 

I usually monitor an input on the device, looking at the timestamp on the data point.  If its older than some amount, I call InitComm(), and repeat calling initcomm every 30 seconds or so until the channel reconnects.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.