LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP disconnects

I have several Labwindows CVI 6.0 programs using TCP/IP. The programs I wrote myself work fine, there is one program that I inherited from some one else. The programs I wrote use TCP/IP to transfer data between a UNIX box and Windows and I had to add the data transfer to the inherited program. I added it with little trouble, however the TCP/IP socket disconnects occasionally in the inherited program, 1 time out of 10, very repeatable. Trouble shooting the problem, it seems that there is something in the program I have inherited that is causing the TCP socket to close. Possibly something consuming to much of the CPU. Are there any functions or operations that can affect the TCP/IP communications in CVI 6.0? Any troubleshooting suggestions?

Mor
e info: The data transfer is compartmentallized. The socket is opened, data sent, then the socket is closed. All the TCP/IP functions are in one source file, one function call is used to start the data transfer.

Operating system: Windows 2000, Windows XP

Thanks
0 Kudos
Message 1 of 3
(3,005 Views)
Hello,
This might be happening because the connection is overloaded. You can check the status of the system resource using Taks Manager.

The best way to find out what is causing the disconnection is by handling the TCP_DISCONNECT event inside your TCP callback function. Inside the "case" for TCP_DISCONNECT, you can call GetTCPErrorString or GetTCPSystemErrorString functions to see why the disconnection happened. Please refer to those two functions in the help file that ships with CVI. This way, you can make sure that the connection gets lost due only to the program you inherited.

Mika Fukuchi
Application Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,005 Views)
.
The GetTCPSystemErrorString() function returned "No Error" in the TCP_DISCONNECT case.

I don't believe that the connection is getting overloaded. I send 1500 bytes, wait for the UNIX box to reply with an ACK and then send another 1500 bytes, etc. until the whole data set is sent.

I'm still leaning towards the Labwindows program is taking too long to send the data which causes the TCP/IP stack on the UNIX box to indicate a disconnect.
0 Kudos
Message 3 of 3
(3,005 Views)