From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1 at TCP close

Solved!
Go to solution

Hello,

 

I have a simple TCP Client (ClientSendRx.vi) which receives string from the server(TCPServer.vi) end and displays the received String. I am facing the following problems:

 

 

1. When I press Stop button at ClientSendRx.vi, I get 'Error 1 occurred at TCP Close Connection'. What should have happened is that the 'Stop' button should stop  the while loop and the TCP connection should have closed and lit either Boolean or Boolean 2 LED depending upon the error status.

 

2.  Under debug mode, when I hit Stop at ClientSendRx.vi , it changes the value from False to True, but does not stop the while loop as it does when not in debug mode.

 

Please advise where I may be going wrong.

 

Thank you.

 

Regards,

 

H.

Download All
0 Kudos
Message 1 of 6
(5,251 Views)
0 Kudos
Message 2 of 6
(5,240 Views)
Solution
Accepted by topic author H P

muks wrote:
check this
 

Ummm... muks, what in the world do the SMTP VIs have to do with the above issue? Other than the fact it mentions error 1 I see no bearing of that KB article to this issue.

 

To OP: You have two different problems:

  • You have hidden code. In the  ClientSendRx there is a TCP Close Connection hidden behind the loop. Move the loop and you will see it. What's happening is that you're closing a connection that's already been closed. Hence the error 1.
  • The Booleans will never light up because you don't have anything wired to them. You need to actually wire a value to them. Otherwise they will just sit there looking pretty.

 

In general, it is not wise to wire a Boolean constant to a loop condition terminal, as you did in the server VI, as this creates an infinite loop. You should wire a Boolean control so you can actually stop the loop without having to resort to the Abort button. 

 

Tip: Use the Empty String/Path? function rather than checking if the string length is zero.

Message 3 of 6
(5,231 Views)

From the kb

 

The internet service provider (ISP) might be blocking the TCP port

Message 4 of 6
(5,229 Views)

muks wrote:

From the kb

 

The internet service provider (ISP) might be blocking the TCP port


What does the ISP have to do with a local connection?  Sorry, muks, but I think you're really reaching on this one...  Smiley Wink

0 Kudos
Message 5 of 6
(5,224 Views)

You have a second TCP close behind the while loop. Once the connection is closed once, the connection ID is invalid and the second close will generate an eror.

 

Press the  "clean up diagram" button to move the hidden TCP close to a visible location. Now delete one of the TCP close functions.

Message Edited by altenbach on 12-23-2009 10:34 PM
Message 6 of 6
(5,215 Views)