LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store new values of array in new row while old ones remain in previous rows

Solved!
Go to solution

Hi,

I'm a student of Elctronics engineering. I have made a VI where I change the values from numeric controls and it saves it as an array.
I want to store couple of new values in new row of this array. 
I have attached a VI where I can change values from numeric control and also the number of rows from another control. But when I change the values, all the values of output array change including values in previous row. I want those rows to be unchanged and only new row to update.

Help needed.


Download All
0 Kudos
Message 1 of 19
(2,962 Views)

Is this the same issue you are facing here?


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 2 of 19
(2,955 Views)

Do I get it right that you want to create a two dimensional array with four collumns and a variable number of rows where the elements are defined row by row?

0 Kudos
Message 3 of 19
(2,951 Views)

I want 4 number of rows. But I want rows which I can change from a numeric control and every time I change row and change my input, the new elements must be saved in new row while the elements in old rows remain same. 



0 Kudos
Message 4 of 19
(2,938 Views)

The thing with 2D arrays is that all of the rows have to have the same number of colums.  So if you add an element to a row, then all of the rows need to add an element.  If you are totally set with 4 rows (no possibility of expansion), then create a cluster of 4 arrays.  Then each array can vary in length as much as they want.


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 5 of 19
(2,910 Views)
Solution
Accepted by topic author NapDynamite

If I get it right you always want 4 collumns. If so one 2D array will do the trick (see attached VI), if not crossrulz' solution should work.

0 Kudos
Message 6 of 19
(2,901 Views)

Thumbs up Bert, thank you so much. This is exactly what I needed.


0 Kudos
Message 7 of 19
(2,887 Views)

@Bert_Hannon wrote:

If I get it right you always want 4 collumns. If so one 2D array will do the trick (see attached VI), if not crossrulz' solution should work.


Come on! Don't use greedy loops in example code. It encourages bad coding habits!

 

(Also one while loop would be completely sufficient here. Don't overcomplicate things)

0 Kudos
Message 8 of 19
(2,883 Views)

Just to make Christian a little happier...


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
Message 9 of 19
(2,878 Views)

I indeed forgot to implement a Wait. But what do you mean with overcomplicating things? I don't think the event structure makes it that less complicated.

0 Kudos
Message 10 of 19
(2,861 Views)