07-11-2012 02:30 AM
Hi,
Iam learning the basic TCP connection.Took an example shipped with Labview.Some changes are made as shown in the attached VI.We have another computer system with the same VI.And we are trying to communicate with the two systems.we entered the IP address of the opposite system.And the connection is established properly.When we change the function to sinewave,chirp etc:- that change can be visible in the waveform graph of the other system.But the problem is when we are trying to achieve a full-duplex communication,it is not possible.The VI that we run first can only act as the server.Please give me possible suggestions.
07-11-2012 02:33 AM
07-11-2012 03:33 AM
OK.Thanks.That was the problem.
I opened the Simple Data Client.vi and Simple Data Server.vi(shipped LV2011 examples) in both the systems and started running both.That time without changing the send and receive port it is working.Can you tell me how it can be?
07-11-2012 04:56 AM
Hi GerdW,
There is one more thing to ask.In the attached VI while running the VI in one system and the VI in the other system is not running,it is showing Error63 "The network connection was refused by the server."How can this be avoided?
07-11-2012 05:27 AM
TCPIP is full duplex, and you could use the same port to read or write data. The example shows only one way connections, where the client vi connects to the server and gets the data.
Two machines establish a TCP connection by creating or using connection end-points that are called sockets or ports. Each machine can have up to 65535 (2^16-1) open ports. So it is possible to have many connections between two machines. One port can be involved in many connections (with different ports on the the other host, or with the same port on different hosts).
07-11-2012 05:29 AM - edited 07-11-2012 05:34 AM
For your application, the process is simple. Put wait on connection function on the server side. When the connection is established from client side, take the data, flatten it to string, then take the string length and do a tcp write, and then the data write using the same function. On other side, do read two times, one for data length and other for the actual data. Unflatten it to the data type used in the server.
07-11-2012 06:53 AM
Hi,
I am also facing the same issue.
I am running a server using TCP/IP connection on a specific port(Ref: Simple Data Server shipped with LabVIEW 2011)
I have received the signal sent from the Server using a client. I need to get alerted on server when a client connects to it.
When TCP/IP connection established with a client, The server should identify it.
Thanks
07-11-2012 09:40 AM
Here is a contrived example I put together once to show bi-directional communication between a client and a server.
07-18-2012 07:38 AM
07-18-2012 07:39 AM