LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combining 2 lines TCP into 1 line

Hi everyone,

I was creates 2 TCP programs, client andserver. 

Client side is open connection and there aretwo functions provided, first are receive the image from the server and second aresend request of Boolean to the server.

Server side is listen connection and there arealso two functions provided, first are send the image to the client and secondare receive request of Boolean from the client.

My questions are: 

Can I combine those two functions into one lineTCP connection (because my current programs at two lines TCP connection) and putit into case structure so I can play the connections several time duringprogram running?

I was try but it no works and some errors comeout so I make it back to standard.

Hope anyone can help me..

Thank you.

Download All
0 Kudos
Message 1 of 4
(4,260 Views)

Hi Papang,

 

Can you elaborate on what exactly you mean by combining the two functions? Are you looking to send and receive on the same connection? How have you been trying to do it so far?

 

Aaron P

National Instruments

Applications Engineer

http://www.ni.com/support

Message 2 of 4
(4,217 Views)

At my VIs just now, there are inside the client and server, client recieve images and send boolean, server send images and recieve boolean. I set up in two lines according each function. What I want to do is, make those two lines into one line using event or case (I don't knwo which one :()

Yes, send and recieve at the same connection. What I'm to do so far is just like VIs that I upload in this board.

0 Kudos
Message 3 of 4
(4,189 Views)

You should be able to combine everything into one connection established from the client side. The connection from the server to the client is not needed.

 

Once the client sends the request, the server can reply on the same connection and send the picture while the client receives it, all in the same loop. This should be trivial. Have you tried? What problems did you encounter?

 

I don't have IMAQ, so I cannot help you much further. In any case a lot of your code is way too complicated. For example to get the local IP (Which is not even needed!) could be done with a near atomic operation instead of parsing the output of an OS specific system command (See here).

 

Message 4 of 4
(4,178 Views)