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: 

Continuously inserting rows into an array

Hello, I'm trying to continuously add data to a pre-initialized array using a timed loop. The goal is to have a new row of data added during each iteration of the loop, with the previously indexed data remaining. Currently my code resets the array (all zeros) and only includes the currently indexed row. The "write to spreadsheet" VI is also a test for writing the array to text, but I was able to get that to work.

 

For example, I want the array to look like this:

 

0 x y

1 x y

2 x y

3 x y 

 

and so on. Currently it will read out:

 

0 x y

0 0 0

0 0 0

0 0 0

 

then

 

0 0 0

1 x y

0 0 0

0 0 0.

 

-Josh

0 Kudos
Message 1 of 4
(2,690 Views)

I don't see anything in that VI about adding to an array.

 

Hint: Look into Shift Registers if you want to append to an array within a loop.

Message 2 of 4
(2,684 Views)

You are looking for shift registers. You need a way to pass the array data from one loop iteration to the next.

 

http://www.ni.com/gettingstarted/labviewbasics/shiftregisters.htm

Message 3 of 4
(2,676 Views)

Shift register, as has already been mentioned, and Replace Array Subset.

 

Lynn

0 Kudos
Message 4 of 4
(2,647 Views)