true wrote: »
This is bound to spit out lots of errors when latency is high or an IP is offline.
JasonS wrote: »
I wrote an IP comm template that uses Send_Commands to configure connection timeout and automatic connection. Most IP devices that I have encountered will automatically drop a connection after a certain amount of idle time. My module has a "Connection Timeout" value that you can set from the main program, if this value is > 0 the module will close the connection after the amount of time specified if the Transmit Buffer is empty. If new commands are added to the Transmit Buffer the Module will automatically reconnect to the IP device. If the connection Timeout is set to 0, the module will immediately attempt to reconnect to the IP device whenever the connection is dropped. If the connection attempt fails the module will then periodically attempt to reconnect, I don't remember how often it tries.
I don't trust timelines for continuous running (I have had issues in the past, timelines mysteriously stopping after 6 months), so I use the "GET_TIMER" function in mainline to get the current system timer value and add an offset to it for my response timeouts and reconnect timeouts in my comm modules.