09-28-2009 04:29 PM
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.
Solved! Go to Solution.
09-28-2009 05:05 PM
09-28-2009 05:14 PM
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!
09-28-2009 06:06 PM
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?
09-28-2009 09:13 PM
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
09-28-2009 09:17 PM