Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Linked Newtork Actor recovering after reboot

I'm trying to develop a simple test application that utilizes Linked Network Actors to communicate between a Windows PC and Real-Time PC. The RT is running its application as an executable that is set to run as the startup application. These are my objectives for the test program:

1. When the real-time PC is rebooted, the communication between the linked network actors should resume.

2. When the application running on the Windows PC is stopped and restarted, communication between the linked network actors should resume.

My current solution is to have the RT application send periodic watchdog messages to the PC. If too much time passes between watchdog messages, the PC should make attempts to reconnect to the RT until either the connection succeeds or the PC application is stopped. I've attached my code.

The problem right now is that I still can't get communication to return after an RT reboot. Do I have to stop the linked network actor on the PC and launch it again if the RT was rebooted?

Any help is appreciated.

0 Kudos
Message 1 of 4
(3,993 Views)

It looks like I forgot to wire the "URL" input to "Send Connect.vi" in PC LNA.lvclass, however wiring it doesn't seem to fix my problem.

0 Kudos
Message 2 of 4
(3,180 Views)

When a connection vanishes (no disconnect message sent) then the remaining LNA (with its network stream) will stay open. Upon reconnecting when restarting a program the connect message will result in an error due to the network stream already being there. The LNA will not Stop, it will close the network stream and it will tell its caller about the error. (-314004 I believe)

At this point you need to have the thing that launched the LNA (which I refer to as the caller) handle that error. Generally speaking what I do is I wait a short period of time (to let the network stream closing finish) and then try the connect method again. I could imagine keeping track of the number of attempts that you have made in the Handle Error of the caller too.

The caller needs to be responsible for the LNA, so just be aware that there are some errors that it reports to its caller. If you don't handle those errors in the caller by overriding Handle Error then the error will go on the caller's wire and up the chain it will go.

I have a 2 cRIO and a PC layout and I have gotten this to work as described.

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


CLA, LabVIEW Champion


Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!

0 Kudos
Message 3 of 4
(3,180 Views)

Right now my issue isn't with the caller (PC) rebooting, it's with the callee (RT) rebooting. The callee does not send a connect message; it is waiting for the caller to connect to it. When the callee reboots, I need the caller to realize that it lost connection and attempt to connect again. The caller will realize it lost connection when it stops seeing watchdog messages. But when my callee starts up again, all attempts to connect to the callee again fail until I stop and restart the caller actor.

0 Kudos
Message 4 of 4
(3,180 Views)