LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp problem

Hello you all
I have a problem using TCP in LabVIEW. It's a very strange situation, so perhaps somebody can help me.

I have two applications, developed following the examples "simple client" and "simple server".
The server listen on port 2055 until the client is connected. Then, the client sends a message, and the server response to this message. This happens each 40seconds. I have three PC where I have tested this on them, and everything works OK.
Now, the server application has been installed on another PC, and here comes the problem: The server accepts the first message and response to it, but the second message is not accepted.
The problem in with the application has been installed now has two network cards, but only one is connected. I have looked into all Operating System network settings and couldn't find the solution.
Can somebody help me??

Thanks in advance
0 Kudos
Message 1 of 5
(2,952 Views)
Esther,

Unless you added code to manage multiple connections, this is the expected behavior with the example you mentioned. Once the first client connection is made, the server is no longer listening for additional connection requests.

For an alternative example that demonstrates using a queue to keep track of any number of client connections, look in the same example library but check out "Multiple Connections - Server", along with "Multiple Connections - Client 1" and "Multiple Connections - Client 2". These examples used to be named "Date Client" and "Date Server" in earlier LabVIEW versions, and while they have never been fully updated to use the native LabVIEW queue structure, they demonstrate old-school (and perfectly functional) LabVIEW 2-style globals.

If I've understood your problem description correctly, you will have to make modifications to your VI so that it does something similar to this. If I've misunderstood, then please reply with more information (What do you mean "the second message is not accepted"? Are there errors produced? Could you attach your VI? etc.).

Regards,
John
0 Kudos
Message 2 of 5
(2,943 Views)
Hi John
No multiple connections are needed, perhaps I haven't explained it correctly.

The server accepts a connection, and through this connection the client sends a message each 40seconds. The server accepts only one client, this is OK.

On several PC's (I have tested it on 3 PC's), the client opens the connection with the server and sends messages each 40secons and the server receives them. Everything works fine.

The problem is that there is a PC where this applications did not work. The client sent the first message, everything is OK, and when sending the second messsage, the server does not receive it. It seems that the TCP socket connection has been closed. The one on with the application does not work has two network card, and perhaps this is the problem. I thought it could be some network card option or configuration, but I can't found it.

I hope now it is more clear

Thanks
0 Kudos
Message 3 of 5
(2,938 Views)
OK, I understand better. I don't know why the multiple network cards would cause a problem, unless the one LabVIEW ends up using to make the connection is faulty.

It's looks as if you'll have to dig deeper into your program and isolate exactly where the connection is being closed. I suggest that you step back and try the shipping Simple Data Server/Simple Data Client pair with the client machine that isn't working properly. If it behaves similarly, you might add some timing code to the diagram to see if there's a consistent pattern behind the duration of the connection before it is closed, etc.

Is there any chance that the bad client machine has a different software or hardware firewall in place that might be detecting and killing the connection for some reason?

--John
0 Kudos
Message 4 of 5
(2,935 Views)
Thank you very much. I will try with the examples in the problematic PC, as you tell me.
Now, enjoy your weekend!!!

Regards

Esther
0 Kudos
Message 5 of 5
(2,931 Views)