LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my Labview application spontaneously discconect TCP conversation?

Not sure why this is happening.  I am working with LV 8.2.1.  I have a host application communicating with a target application on a PXI controller running LV real-time.  About 15 seconds into the software, the host randomly, for no reason I can tell, disconnects the conversation.  What are the possible causes?  The first time I know that it has happened is that it then complains that it cannot read from the target because the connection has been reset.
0 Kudos
Message 1 of 5
(2,619 Views)

It seems there is a problem in the RT application running on the PXI.

 

What kind of TCP communication are you doing? (plain lowlevel TCP, datasocket, web services, shared variable engine, etc...)

 

Can you show us some code?

Message 2 of 5
(2,613 Views)

Low-level TCP.  Here's some code.  I pulled out some TYPEDEFs as I am not able to ascertain whether the information is company-proprietary or not.  Probably not a big deal, but just to be sure...it's basically just the details of what exactly is being transmitted.  I will chase down permission to post if you think the issue lies there. 

 

I was able to implement a work-around, as you can probably see in the code.  Whenever the module runs, it attempts a reconnect, if it is not connected, or if the connection is closed.  Just FYI, the real-time receive module runs at 50ms period and the transmit runs at 2 Hz.

0 Kudos
Message 3 of 5
(2,578 Views)
So I see a case structure in the code which reads whether a 62, 64, or 66 error occurs.  If so, it clears the error and closes the connection, but does not give any report to the user that this happened.  Maybe put an error indicator there before you clear the error programmatically, removing all evidence of a problem?
Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 4 of 5
(2,553 Views)
I have since updated to give the user an indication (on the debug monitor) that such an event has happened (as well as reconnection attempt status).   However, prior to adding the code to disconnect and attempt reconnections, I was receiving all error information.  That is what prompted the initial post.  There was no indication of why the connection was closed, just that it had been.  Using a WireShark trace I was able to discover that it was disconnected by the host, but there was no indication within LabVIEW about why.
0 Kudos
Message 5 of 5
(2,536 Views)