LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Random 3 second delay in TCP comm b/t PC and RT Target

(Note: I've posted this to the general LabVIEW forum as well)

Hello,

I have been struggling with this problem for quite some time now, and haven't been able to work it out:

I am using the LV TCP functions to communicate between a PC and a Real-Time system (PXI-8186). I am trying to transmit ~4kB from the RT system and ~200 Bytes from the PC every 100 ms (i.e. only ~40 kB/s). On most iterations, it works fine - however, sometimes there is a delay of approx. 3 seconds (always between about 2800 and 3000 ms). The delay appears to occur while the RT system is writing and the PC is waiting for data to read. I have tried splitting the data up into various sizes, with various wait times between each write, which does seem to improve things, but I still am not able to totally eliminate these delays.

I have experimented with disabling the Nagle algorithm or just appending the size value to the data string and doing only one write from the PC. Both of these let me communicate properly (without doing one of them it would only write every 600 ms), but they don't change the problem.

I've also tried out the "netbench"/"Maximum TCP Transfer" tool to try and map the transfer speeds using different packet sizes and wait times, but wasn't able to find anything conclusive. The delay can happen on the order of once every minute or more, so it doesn't show up using these VIs.

I've seen this problem on more than on PC and more than one Real-time system.

Any help would be greatly appreciated.

Jaegen
0 Kudos
Message 1 of 6
(4,128 Views)
Please disregard this accidental double post - I haven't had my coffee yet today
0 Kudos
Message 2 of 6
(4,120 Views)
Jaegen,

Is your RT target on a network or a direct connection? (crossover cable) How much better did the data transfer get when you made the packets smaller?

-Brett
0 Kudos
Message 3 of 6
(4,104 Views)
Brett,

The target is connected to the PC through a network switch, which I think is as good as a direct connection.

I've managed to get reliable communication by splitting up the data into packets 128 bytes long, with a 1 ms wait between sends. Unfortunately this limits my transfer rate to 200 Hz, since it ends up taking almost exactly 100 ms to send all the data.

Jaegen
0 Kudos
Message 4 of 6
(4,058 Views)

You might also consider installing the 7.1.1 maintenance release for LabVIEW and LabVIEW Real-Time. The Readme for LabVIEW Real-Time 7.1.1 describes how you can improve your ethernet performance for PXI and CVS Real-Time systems. Does this help, or are you getting the performance you need from your most recent modifications?

Regards,

Kristi H
National Instruments

Message 5 of 6
(4,045 Views)
Well I finally had some time to go through the upgrade process to 7.1.1 (for both regular and RT), and this has completely solved the problem. I no longer need to split up the data into chunks, and I'm not seeing any noticeable delays.

Thank you for solving this problem.

Jaegen
0 Kudos
Message 6 of 6
(3,994 Views)