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: 

tcp/IP 2 ports server two-sided communication

Hello

My task is to implement two-sided communication through tcp/ip.

It has to be asynchronous (two connections working independly) so I decided to create a server that uses two ports and the same to the client.

After looking at examples(simple data server,client), what I did was just copy while loop and configure the copyied loop to read bytes.

So one loop sends data, another receive- thats the server.vi. - I did the same to client. (there are two loops per VI,2 ports)

It seems to work fine, when I`m sending data INDEPENDLY f.g loop iterations, but

there is a problem when I try to:

1.send cluster from server to client (sending and reciving port )

2.After using some written stuff, to send cluster from client recieving loop to client sending loop (within one VI)

3.Send the same cluster back to server.vi

4. Send Cluster (it can be any variable actually) between server loops

5. Modyfy that variable (i.e of cluster) by incrementing it .

6. Doing things included in point 1.

 

I thought thats the way to obtain the highest speed connection, however the variable is modyfied in the very low speed, much lower than connections are establish. I thought that they matched to each other.

 

I attach an examples with only 1 variable (thought is clear). The example using clusters works very much slower

 

 I appreciate any help !

With best Regards

Jakub

 

Download All
0 Kudos
Message 1 of 3
(2,717 Views)

TCP is a bi-directional protocol so you should use a single connection. A single connection may also be faster due to the way the Nagle algorithm works (it is designed to minimize packet overhead by combining multiple small packets into a single larger transmission, and it works best on a single bidirectional link). It is not clear what you're trying to do here; it would be more helpful if you include the entire example with the clusters.

0 Kudos
Message 2 of 3
(2,688 Views)

Hi Jakub!

 

If you're looking into maximising speed for TCP-IP, I encourage you to check out this thread. Lots of useful information.

 

Best regards:

 

Andrew Valko

NI Hungary

Andrew Valko
National Instruments Hungary
0 Kudos
Message 3 of 3
(2,660 Views)