Showing results for 
Search instead for 
Did you mean: 

collecting and clearing elemnets after dimension reaches to [x values] in an array

Hi all,


I need some help, here what I am trying to do is to take 3 channels from acquisition device (BIOSEMI) and collecting 8 elements each time in 3 different array until it reach to 256 elements. Once these arrays are filled with 256 elements, then transfer it for further processing but at the same time reset these 3 arrays to again collect another 256 points in 3 arrays.


How can reinitialize my arrays after every 256 points but at the same time keep forwading these 256 points for plotting and further porcessing?


Many Thanks.



0 Kudos
Message 1 of 5

Sorry, here is block diagram image.

0 Kudos
Message 2 of 5

Hi Amna,


- please clean up your VI before uploading…

- replace InsertIntoArray by BuildArray when appropriate…


What kind of help do you expect when all you provide is a picture of a block diagram? Should we use GIMP to paint into that picture?


To answer your question:

IF array.length >= 256 THEN
   array := []

 Sounds like you need a simple Case structure (or a Select node).

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5

Hi GerdW, thanks for you reply. I was trying to upload the vi but it needs other file to open (.dll) which is unsupportive format.  


Thanks for solution, I'm trying to apply it and will update soon.

0 Kudos
Message 4 of 5

That sounds like you need a FOR loop to me.  Just make it iterate 256 times, autoindexing your read values.  When the loop is done, pass on the data.  Next time you come to the FOR loop, the array will be reinitialized.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5