‎06-29-2009 01:02 PM
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.
‎06-29-2009 02:33 PM
Hello BrandonGT,
Are you connected to the FPGA from the RT controller or are you opening the FPGA reference directly from the PC?
Sebastian
‎06-29-2009 04:05 PM
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
‎06-29-2009 07:10 PM
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.
‎06-29-2009 11:42 PM
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
‎07-01-2009 02:58 PM
‎07-02-2009 10:11 AM
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