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: 

datasocket too slow, fastest way to transport data between two computers

i'm having an aquisition system running on one computer that needs to feed the data in real time to another computer at ~40mbyte/s to process. i'm running a datasocket server at the aquisition computer and have the second computer read packages of data from the datasocket server. but turns out it takes close to 2 sec to write 1 sec worth of data onto the localhost datasocket server. the two computers are connected through a private 2Gbyte local private network, so LAN speed is not an issue. is there some trick i can use to configure the datasocket server or client? or what is fastest way to stream data between two computers?
0 Kudos
Message 1 of 5
(2,665 Views)
In your case, I recommend using the UDP VIs, which offer the least amount of overhead of all the network communication methods. UDP is an unassured service, meaning your packets might not get to the receiver in order, or might not get to the receiver, period. On a private network, you can minimize UDP packet losses if you have a way to avoid collisions. If you have control over the network topology, you may even be able to ensure all UDP packets arrive in order.

If you need an assured service, use TCP VIs. They'll guarantee all your packets arrive (and arrive in order).

The disadvantage is you lose the convenience of Datasocket.
0 Kudos
Message 2 of 5
(2,665 Views)
thanks a lot Bob! i'll look into that. so does that mean that ~40mbyte/s is just too much for datasocket to handle, and its overhead cannot be reduced?
0 Kudos
Message 3 of 5
(2,665 Views)
I think it's safe to say network throughput with Datasocket, TCP, or UDP is a function of how much data you hand to the Write function in LabVIEW in addition to the raft of other characteristics that define a network. I mention the Write function because it's the one thing you have most control over, including how much data you pass to it as well as how frequently you call it. You have a ton of bandwidth, so it might be possible to hit the desired rate with DataSocket if you find the "right" packet size.

Here's a tool for doing just that with TCP. You should try the tool, and use the solution as a starting place for Da
taSocket. Good luck.
0 Kudos
Message 4 of 5
(2,664 Views)
i used tcp/ip and after some testing using various sized package size, i was able to reach a 30mbyte/s rate. thanks!
0 Kudos
Message 5 of 5
(2,664 Views)