LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP OPEN CONNECTION ERROR 63

Solved!
Go to solution

Hi,

I need a Connection to several devices with TCP/IP.

In the past this was fine but now there is a problem I can’t solve...

I can connect up to 5 devices and everything is fine. As soon as i try to connect more devices I always get an Error 63.

I tried different  chronology and much more and don’t fine the reason for this behavior...

I added a simple Vi (SimpleVI) which should connect to 11 Devices...

 

 

Thanks for your  help.

 

 

 

0 Kudos
Message 1 of 7
(5,816 Views)

Looking at your code, I could not find any "Close connection". You should handle the close connection, on both the VI side, and the device side. LabVIEW connection usually closes its own connections when the VI terminates but this is not a good practice. On the device side, if the connection is still open, you will run into errors.

The OS might also prevent to reuse some port values within a certain delay, especially when the open/close are not properly handled.

Marc Dubois
0 Kudos
Message 2 of 7
(5,769 Views)

Looking at that "driver", it is 20 years old and originally developed in LabVIEW ~3. Isn't there something newer? At least that stacked sequence could be unrolled. Since the contained VI is not reentrant, it does not even need to be there.

I don't quite understand the toplevel VI. What exactly are you supposed to do with all these returned connection IDs? Where did you get the driver? Is there a manual?

 

Error 63 means that the connection was refused by the server. Are you sure the problem is not at the other end? There could also be firewall issues and such. You are connection to 5 devices in the first subVI, then you are connecting to the same devices while the original connection is still open (+ one new device). Do these devices allow multiple concurrent connections from the same client? What if you try to connect to 11 different devices instead?

0 Kudos
Message 3 of 7
(5,760 Views)

Thanks for the quick answer!

 

What i want to do is to get the data from up to 11 devices what work pretty well in the past.

Therefore I use these old drivers. Until now I was not able to find something newer...

Here is the manual of the device I am talking of:

https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwihmPjmtZ3VAhUB8RQKHcEOB3wQ...

 

The real program is much bigger so I decided to just upload the initialization part.

In principle the whole program at first should open the TCP connection then get the data in a loop and then close the TCP connection.

This works well for up to 5 devices which means 5 TCP connection at the same time. But as soon as I try to connect more devices I get the Error 63...

The strange thing is that it worked already with all devices and I don’t know what changed.

 

 

Thanks for the help!

0 Kudos
Message 4 of 7
(5,750 Views)

So in the real program you are targeting all different IP addresses?

0 Kudos
Message 5 of 7
(5,747 Views)

Yes that is correct! 

each device has a different IP address but the same port ( 9000) 

0 Kudos
Message 6 of 7
(5,728 Views)
Solution
Accepted by topic author zenost

@zenost wrote:

Yes that is correct! 

each device has a different IP address but the same port ( 9000) 


Then that is your problem and it did not work in the past in this way as you claimed. While a TCP//IP server can support multiple clients to connect to it at the same time, it must be programmed to do so. The more simpler approach is to simply have one thread in the device wait for a connection and then handle that until it is terminated and then go back to listening and waiting for a new connection. That is much simpler to program and therefore sometimes used in simple embedded devices.

So the problem is your device that can only handle one incoming connection at any time. And as long as you communicate to 11 different devices it will work but if you try to change your program to connect to the same device twice (maybe because you only have 6 devices at the moment) it won't work anymore.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 7
(5,711 Views)