LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP comms from Host to RT target; Maximum transmission frequency

Hello,

 

 

Is there a hard limit on the frequency that a single TCP/IP read/write can occur?

 

I am currently using a RT desktop (Labview 2009) with a host pc. In a simple VI I created, I tried to send a simple 4byte string as frequently as possible, from a Host VI to the RT target VI. The host has a timed loop, which tries to send this string 60 times per second, (one message every 16ms).  The RT listener VI uses a while loop to do the reads. This inter-arrival time of 16ms is what is highly important to me.

 

My problem is that, according the the RT Execution trace toolkit AND the RT-timestamp analyzer, the tcp-read can only occur every 25ms. From the RT-Execution trace, the read is triggered by the ETS TCP/IP Timer Thread, which appears to run every 25 ms.  As such, sometimes two of the packets are processed at the same time (microsecond difference) and other times its every 25ms.

 

Is the ETS TCP/IP  Timer Thread the cause of the forced 25ms wait between reads? Is the changeable?

 

Thanks

 

M. Gardner

Message 1 of 3
(2,451 Views)

TCP/IP is not a real-time protocol. It uses a buffer and doesn't necessarily send the data each time you use TCP write, but might wait for more data for some time because sending of larger chunks less frequently is more efficient (Nagle algorithm). So don't expect to have ms timing accuracy using TCP.

On top of that, Windows (I guess your host PC is running Windows) is not deterministic either. You can configure a timed loop in ms, but Windows might be busy doing something else from time to time and be a bit late.

 

Probably you should try to redesign your code so it doesn't depend on exact timing, especially not between a host system and a RT system (between 2 RT systems Ethercat could help).

 

Hope this helps

 

Message 2 of 3
(2,444 Views)

Hi M. Gardner,

 

I realise that this is an old thread (posted over 14 years ago), but do you have an update on the maximum TCP write/read frequency you were able to achieve?

 

I am exploring a similar question right now (December 2024).

 

I have been able to achieve TCP message rates of 140 Hz (loop period of roughly 7 ms).

 

Sender details: cRIO-9045 using a regular while loop (not a timed loop) to send variable-length TCP messages as fast as possible. The length varies between 14 bytes and a 200 to 300 bytes.

Receiver details: Windows PC using a regular while loop (not a timed loop) to receive the TCP messages.

 

The PC is running Windows 11. Both the PC and the cRIO use the latest version of LabVIEW, which is LabVIEW 2024 Q3 (24.3.2f2) 64-bit.

 

Thanks,
Petru

0 Kudos
Message 3 of 3
(162 Views)