LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mazimize ring buffer size for continuous image grab

Hi all,

 

I have a VI setup based on the low level ring.vi. I am trying to grab images at a high frame rate to a large ring buffer, and then when my capture is completel, unload the buffer to files.I have the vi working well, but their seems to be a limit to how many buffers I can use. When I go over about 999 buffers, not only does allocation take vey long, but he frame rate seems to go down during capture. My image size is only 128x127 in 12 bit, so my image files are quite small. But 999 buffers limits me to only a couple seconds of continous imaging at ~500 FPS. I am okay with losing some speed, but I would like to take about 10 seconds of capture.

 

A few ideas:

 

1. I have read some threads suggesting it may be better to have two separate rings, each with half the amount of buffers. (not sure if this is possible or helpful).

 

2. Are the image buffers automatically allocated to the correct size or do I have to tweak my vi to do this. Could the ring be allocating for much larger images when my images are only 128x127?

 

3. I am using an older computer with  pentium 4and only 750MB if ram. While 7500 frames shoul;d only take about 184MB of ram, could this be the issue. Allocation does seem to take about 30 seconds for 999 frames.

 

Thanks for any ideas

0 Kudos
Message 1 of 10
(3,516 Views)

Here is the vi I am using if it helps.

0 Kudos
Message 2 of 10
(3,515 Views)

Hello anfleisch

 

Thank you very much for choosing National Instruments.  I am committed to seeing this issue resolved but before we continue, I am gonig to trouble you with some preliminary questions.  Can you please tell me which operating system and which version of LabVIEW you are running?  Do you currently have the most up to date NI Vision drivers?  What happens once the limit is reached?  Is there an error code that is generated when this occurs?  Please let me know so that I can continue assisting you with your project.

 

All the best!

Sincerely,

Greg S.
0 Kudos
Message 3 of 10
(3,498 Views)

Hi Greg,

 

It seems I am able to get about 2500 buffers now. I added a set image size to my 128x127 size, but I am not sure if I just wasn't letting the VI finish running. When I am above about 3000 buffers, the frame rate seems to run down and sometimes the VI/computer was crashing. Above about 4000 I was crashing and getting messages that said memory too low. 

 

Could I need to upgrade my memory? I am a little low at around 750MB, which I could max out at 2GB. I didn't think memory would be an issue since the files are only about 12kb in PNGs x 2500 files is not that big overall.

0 Kudos
Message 4 of 10
(3,490 Views)

Hello anfleisch

 

I am thrilled you are making progress.  Can you please run the Windows Task Manager and select the performance tab and then run your LabVIEW application.  Does the memory actually max out the longer the program runs?  Is there another more powerful machine that you might be able to test this on?  Please let me know if you need assistance carrying out the above mentioned tasks.

 

All the best and I look forward to your response!

Sincerely,

Greg S.
0 Kudos
Message 5 of 10
(3,484 Views)

I will check that out in the morning. I am thinking this may be the result of eating up the onboard framegrabber memory. Does that sound possible? The 2500 or so frames is topping out at about 30 MB, and I seem to remember the framegrabber has about that in on-board memory.

 

If that is the case, is there anything I can do to increase my capabilities.

0 Kudos
Message 6 of 10
(3,474 Views)
hi Anfleisch
I could not open your VI since I am using LV2009 and your VI is in 2010
I am trying to do the same (400x400x8bit images) at 2000fps using LLring with buffers.
And if I do look at windows task manager I do see that I hit >2GB memory once I try to record more than 4000 frames. So yes it is true that you can quickly fill up the memory. It seems like the PNG filesize that you mentioned is AFTER compression. the actual momory size ofeach of your files is 
128x127x12 = 195072 bits = 24.384 KB (3000 fps = 73MB per second). That should fill up your memory. More memory is a good idea.
There is also an alternative (but I could not get it to work) where you acquire and dump images into a queue and in a parallel while loop dequeue at the same time. That way, as you keep filling the memory you are also releasing it. but for some reason I could not get it to work for images.
This is what I think. Will appreciate someone elses comment on this.
gvstemp

@anfleisch wrote:

I will check that out in the morning. I am thinking this may be the result of eating up the onboard framegrabber memory. Does that sound possible? The 2500 or so frames is topping out at about 30 MB, and I seem to remember the framegrabber has about that in on-board memory.

 

If that is the case, is there anything I can do to increase my capabilities.


 

0 Kudos
Message 7 of 10
(3,464 Views)

Saving and dumping during the acquisition doesn't really help too much since not too many images will be saved anyway. The files are only about 12 kb after compression, but the buffers may be set at 26 kb since I used image set to size at 128x127. Not sure if that is an accurate statement. Is it possible to set the buffers to a smaller size since maybe they are using up more than the 12 kb that I require. Still, less than 100 mb doesnt sound like that much.

 

If you would like, I may be able to save the program as a LV 2009 for you to use.

0 Kudos
Message 8 of 10
(3,457 Views)

Saving to queue and simultaneous dequeuing would be great to achieve if someone wants to record for 100s of minutes.

 

I have another thread (Where I have pasted my code as well) where I tried the queuing trick. However I am also trying to record simultaneous and in sync voltages as well. Currently I am trying to figure out how to get common timestamps for both acquisitions.

http://forums.ni.com/t5/LabVIEW/HELP-ACQUIRING-IMAGES-AND-ANALOG-SIGNAL-SIMULTANEOUSLY/m-p/1579464

 

Also, I think it will be nice to see your code as well. There is always something new to learn.

You could either downsave to LV2009 or just paste the screenshot of your code, which ever is simpler.

 

cheers

 

0 Kudos
Message 9 of 10
(3,452 Views)

Mine is a very simple adaptation of LL ring. Has a time included and it stops after the buffers are acquired until you hit the acquire button.

0 Kudos
Message 10 of 10
(3,449 Views)