09-08-2015 09:51 AM
Why would I get the error shown in the picture below when no errors pop up on either my host or RT programs? I'm running in debug mode.
09-09-2015 06:30 PM
Would you be able to describe your set-up a bit more? If this error pops up on your PC screen, is that not the host in this case? What is your host and what is your target?
09-09-2015 09:38 PM
Hello Michael!
Thanks for posting! Unfortunately, this error can be caused by lots of different reasons. Essentially, it means that the network lost connection to the device that you were attempting to execute your code on. The most common cause of this I have seen is that the user will put a while loop in their code without any wait timing. This will cause the while loop to rail the processor on the RT device and it will not be able to do any network communication. This would also explain why no error is associated with the loss of connection. Is it possible to post your code to the forum?
09-10-2015 09:45 AM
There is a program written in CVI running on a RT PXI target which reads AI and TCPs it to a program written in VB.NET. I've been working on it for a while without seeing this message and I didn't add any while loops lately. The problem is random. I can run it for several hours and then I get this message and it stops running. That makes debugging difficult.
Here are the only two while loops in the main operation. For now I have deverted the TCP data to the debug window to eliminate that section.
while (!RTIsShuttingDown()) // || !flagInProcess)
{
ProcessSystemEvents();
SleepUS (10000);
}
while (BytesToWrite > 0)
{
BytesWritten = ServerTCPWrite (gTCPConnectionHandle, msgToSend, BytesToWrite, 0);
BytesToWrite -= BytesWritten;
}
09-11-2015 04:48 PM
Hi Michael,
Have you considered implementing a heartbeat check in your code to occasionally check for proper connection?
06-06-2016 08:54 AM
I will probably have to do that eventually, but I know the program is still running.
It sends TCP data to a Windows host at 2 Hz, and it is still doing that right now. This means that Labwindows/CVI lost communication with the PXI system, but to PXI system is still functioning. Is it possible to reconnect from CVI without restarting the PXI system?
06-07-2016 12:21 PM
Hi Michael,
Have you checked if your Real-Time Target's Memory or CPU Usage is running high when this disconnect occurs? The debugger connection would likely be the lowest priority process on the target, resulting in the behavior Collin mentioned previously above.
Since it is the debugger that is disconnecting and not the actual PXI Controller, there is unfortunately no way to reconnect. As per the following help document, once the debugger is disconnected from the target the program will continue running but the debugger cannot reconnect.
http://zone.ni.com/reference/en-XX/help/372398G-01/cvirtmodulehelp/runninganrtapp/