LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what is the maximum size of indexed array that can be created during execution of while loop?

Hello,

I am using a ring acquisition to take in images. If i write them as files in the loop, it slows down the acquisition unacceptably. Therefore i am converting image to array and storing the array until the acquisition is complete and then reading the array and converting back to image to save. The program sometimes runs out of memory (after a couple of minutes). Can anyone think of a way where i can store the array/images within the execution (without losing image information), without slowing it down and to avoid this memory problem?

I have included the VI.

Thanks in advance for any help or advice.

kindest regards,

FraserD
0 Kudos
Message 1 of 3
(2,828 Views)
When you build the array of pictures you do it using auto-indexing out of a while loop. That means that memory is aquired for a copy of the previous picture array and the array is rebuilt on every iteration, this is slow and requires a lot of extra memory.

If you want to speed things up try initializing a shift register with a 3D array of a size that will be able to hold a certain number of pictures, then replace the "pages" as new pictures are aquired, replace operations do not require copying of the previous array and will thus be much much faster. The difference is exeptional when dealing with large arrays/amounts of data.

Now, the shift register buffer could be built into a functional global, and you can add a push/pop logic to it so that you can have a p
arrallell loop that works on writing the elements to disk. You could use a que for this, but I think even though you specify a size limit to the que it still aquires memory as new elements are added (correct me if I'm wrong people...:-)), so a functional global acting as a circular buffer og fixed size frame for a que should be better.
0 Kudos
Message 2 of 3
(2,828 Views)
Mads,

Thanks for that interesting answer.

Do you mean initialise an image array or continue using image to array conversions?

I tried it with the original arrays and when it writes the image they were blank?

Do you have a bit of code to describe what you mean?

Thanks in advance,

FraserD
0 Kudos
Message 3 of 3
(2,828 Views)