From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array clearing and appending

Hello

 

I am reading 100 samples on the run. I need to save these samples in an array do some computation and then clear that array to store next set of 100 samples.

 

i have a while loop, using logic of quotient remainder block i get integer output from 0-99 (using shift registers and quoteint remainder block). I plug the output to index of insert into array block.

 

However the array keeps on appending

 

How can i clear the array after every 100 samples are stored.

0 Kudos
Message 1 of 4
(2,220 Views)
You should be using the build array function with a shift register. When you reach 100, write an empty array to it.
0 Kudos
Message 2 of 4
(2,215 Views)

I would initialize an array of 100 element in a shift register and use "replace array subset" to fill with new data. Whenever all 100 elements have been replaced, process the array and start over. Since all elements will be overwritten when it is time for the next analysis, you don't even need to clear the old data.

0 Kudos
Message 3 of 4
(2,191 Views)

Just to better show what Christian is talking about...


GCentral
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 4 of 4
(2,156 Views)