From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT sbrio how to force it to reset when tcpip lost

Solved!
Go to solution

I'm want to force sbrio 9640 to reset when tcpip connection lost. But I don't know how.

Using labview 2019 

0 Kudos
Message 1 of 3
(770 Views)

Hi e.,

 

when the connection is lost you will get an error. In this case you can use the watchdog to reset the sbRIO...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(741 Views)
Solution
Accepted by topic author e.gtoto88

@GerdW wrote:

Hi e.,

 

when the connection is lost you will get an error. In this case you can use the watchdog to reset the sbRIO...


But you need to be a bit smart about that. Not every TCP/IP error indicates a bad thing. For instance if you implement a server with a TCP/IP listener, the wait for listener will return with a timeout error (56) whenever there was no client attempting to connect. This is fully normal and should be filtered as being not really an error, just as an indication not to expect a valid connection refnum.

 

Same about TCP Read. Unless you are the initiator of a command response interaction, you will usually invoke the TCP Read to see if there is incoming data. And you will usually want to define a positive timeout so that your loop doesn't hang in there forever if no messages come in and the remote side just decides to keep the connection open but not doing anything for now. In that case you will also receive a timeout error.

 

And what to think about the fact that the remote side simply had enough and disconnects, or lost power or whatever. Do you really want your sbRIO to continuously reboot? You should probably first think about making your TCP/IP communication more robust in itself. That involves making a somewhat more involved TCP/IP handler that runs in its own loop. And by investigating the error cluster of the nodes you then decide if you just loop back waiting for a new connection, more data or something, or if you might close the connection and try to reopen it. And only if you receive a really unexpected error, will you take the last resort and send an abort to all other loops and then restart the entire app. Even that does not necessarily mean to restart the controller but rather just the outermost loop.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(724 Views)