LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Discover TCP-IP connection loss using CompactRIO

I am looking for a way to detect when the TCP-IP connection is lost in my FPGAcode on the compactRIO. I want the FPGA to go into an "emergency" mode if the TCP-IP connection is lost to the host computer. I have done some searching and come across the Datalogging and Supervisory Control module for LabView but I am not exactly sure if this is what I am looking for. I wanted to confirm that I can do this with this module before purchasing it.

 

 

Any advice would be greatly appreciated. Thank you.

0 Kudos
Message 1 of 7
(3,546 Views)

Hello BrandonGT,

 

Are you connected to the FPGA from the RT controller or are you opening the FPGA reference directly from the PC?

 

Sebastian

0 Kudos
Message 2 of 7
(3,533 Views)

It's not exactly what you asked, but what I do is set up a watchdog loop on the FPGA. If the controller doesn't whack the dog every xx ticks, the FPGA will reset the controller. You could implement your "whacker" in the communication loop on the controller, and if it fails to timeout or receive a message in a time interval, it could cause the controller to reboot (or go into some sort of emergency mode--but I've had good luck with rebooting).

 

Chris

0 Kudos
Message 3 of 7
(3,524 Views)

I am opening the FPGA reference in a vi running on the PC. My knowledge of this is probably less than most of you here so if I don't make sense I apologize.

 

 

My system has a pc connected to the compactRIO through a switch. I want the compactRIO to perform some code if it ever loses contact with the host PC. I like the watchdog loop idea, I was thinking of something like that before, but so far the compactRIO seems to do strange things when it loses contact with the host code and I thought that might not work.

0 Kudos
Message 4 of 7
(3,514 Views)

there is a checkbox in the configuration in MAX that says halt system if TCP/IP fails

 

I think it is checked by default and if you have the cRIO set for DHCP and it is not connected to a network then RT will not start

 

I uncheck this checkbox

 

 

 

Also in your com logic you should get an error when you loose connection if you use the error terminals

- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 5 of 7
(3,503 Views)
So is rebooting the controller due to loss of communications something you have to do very often? I have had issues where communications loss occurs as well as where the compactRIO sends unpredictable signals when timing engines are started on it.
0 Kudos
Message 6 of 7
(3,473 Views)

During development this happens to me all the time. Especially when timed loops are running. If the rio is spending all of it's time keeping the timed loops running, then the networking code may not execute for long periods of time (or at all). The trick is to get all the code running on the rio comfortable, with enough idle time to handle other tasks (like FTP..).

 

I'm not so sure what you mean about "unpredictable signals" though. One thing to keep in mind is that when you are running a vi on the rio through LabVIEW, there is overhead associated with updating the front panel on your PC. Alot of times, a deployed program will not run the same when connected to a host pc vs. running headless on the rio. I like to generate a text log file to let me know what's going on with the program when it is running headless.

 

Chris

0 Kudos
Message 7 of 7
(3,460 Views)