LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert into array, Array fails to grow

Solved!
Go to solution

I'm currently learning Labview 2009. 

 

Problem:

I have a 2D array with 3 columns that I initialize outsize my main loop.  Within my loop I want to append new rows to the array as I collect data.  I've tried using "Insert into array" but can't seem to get new rows to append.

 

I've attached an example VI to show you what I'm doing.  Basically I initialize the the array outside the loop to 0 rows, 3 columns.  Inside the loop I look at the number of existing rows and then try inserting a 3 column 1D array.

 

I'm an old VS / VB coder trying to adapt some skills to Labview.

 

The purpose of this array incidentally is to collect temperatures over a period of time and in order to determine the overall variation over a given time period.  Any additional ideas would be welcomed.

0 Kudos
Message 1 of 6
(3,860 Views)
Solution
Accepted by Timeslice
You can use a shift register and build array. See attached example
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
Message 2 of 6
(3,852 Views)

Hi Andrew,

 

That's perfect.  That's exactly what I want it to do.

 

I'm not clear on why my original VI doesn't behave in the same way, but your elegant solution solves my immediate problem in a more straight forward manner.

 

Thanks!

 

 

0 Kudos
Message 3 of 6
(3,848 Views)

Timeslice wrote:

I'm not clear on why my original VI doesn't behave in the same way, but your elegant solution solves my immediate problem in a more straight forward manner.


You might want to mark Andrews post as solution, not your own.

 

The reason your original VI does not work is obvious. With every iteration of the loop, you start out with an empty array from the input tunnel and insert one row. Nothing in your VI keeps a history of previous insertions. Right?

 

Message 4 of 6
(3,825 Views)

altenbach wrote:

Timeslice wrote:

I'm not clear on why my original VI doesn't behave in the same way, but your elegant solution solves my immediate problem in a more straight forward manner.


You might want to mark Andrews post as solution, not your own.

 

The reason your original VI does not work is obvious. With every iteration of the loop, you start out with an empty array from the input tunnel and insert one row. Nothing in your VI keeps a history of previous insertions. Right?

 


 

Yes, that indeed makes sense.  Apoligies to Andrew for clicking the wrong link to apply the kudo - my first day with the new message board.  I've looked for a way to switch the solution to his message, but dont' see a way to do that (if there's a way let me know and I'll correct that).

 

I'm early in the learning curve for Labview and the excellent (and very fast) response from users is very encouraging.  Its quite an adjustment transitioning from Visual studio to LV. 

 

Once again, sincere thanks for the help from both of you.

 

Scott

 

0 Kudos
Message 5 of 6
(3,814 Views)
Go to the options menu to the upper right corner of your message.  You can select Unmark solution.  Now you can go back and mark Andrew's as the solution.
Message 6 of 6
(3,811 Views)