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,876 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,870 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,862 Views)

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

 

Lynn

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