LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

circular (ring) string buffer for high speed UDP/IP

Highlighted

Hi all

 

I wanted to share with the group my recent experience with working with large string buffers, especially when working with the fast UDP communication. Perhaps somebody had similar problems and maybe that will help solving them.

 

When using LabVIEW to collect 20Mb/s from the UDP/IP network for a longer time I found that the limiting factor for the dropped data and performance is the ability for LabVIEW to cope with the received data. The UDP packet size has an effect so I tried to keep it large, but still it was just a band aid for the real problem.

 

Since LabVIEW does not have any memory allocation for strings in the beginning I simply added more string data and concatenate the strings. When the buffer reaches single MB I noticed that the UDP data is being dropped.

I suspected it has to do with the fact that LabVIEW needs to allocate a large memory for the growing and growing string, but when I started to search the net most of the advices were that LabVIEW does not need to allocate the memory for the strings.

 

Well, I found that it has to and not only to allocate the memory but to use the string circular buffer to feed the data into the ring and replace the old data in it.

 

Once I developed the circular buffer I have no more issues with the IP communication exceeding 20Mb/s with arbitrary packet sizes. It is very stable, takes minimal CPU time and is really working for me.

 

If someone is interested I enclose the vi files with example on how to use.

 

Cheers

Pawel

 

 

 

Message 1 of 5
(1,887 Views)
Highlighted

hi

I am facing a similar problem. Could you post it in labview 2010 ?

thnks 🙂

0 Kudos
Message 2 of 5
(1,633 Views)
Highlighted

Hi su_a

 

I think this is what you need.

 

Regards,

steve.bm
AE | NI
Message 3 of 5
(1,615 Views)
Highlighted

Hi Pawel,

I'm currently also experimenting with high-throughput streaming via UDP and am getting packet drops, so I'm keen to give this a try.

Thanks for posting your experiences & code for others to learn from. Smiley Happy

 

Thanks also to Steve for the conversion. Good job guys!

0 Kudos
Message 4 of 5
(1,341 Views)
Highlighted
You are very welcome.
0 Kudos
Message 5 of 5
(1,329 Views)