01-07-2013 06:36 AM
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.
Solved! Go to Solution.
01-07-2013 07:12 AM
Is this the same issue you are facing here?
01-07-2013 07:38 AM
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?
01-07-2013 11:10 AM
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.
01-08-2013 07:38 AM
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.
01-08-2013 08:12 AM
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.
01-08-2013 11:21 AM
Thumbs up Bert, thank you so much. This is exactly what I needed.
01-08-2013 11:25 AM - edited 01-08-2013 11:27 AM
@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)
01-08-2013 11:40 AM - edited 01-08-2013 11:40 AM
Just to make Christian a little happier...
01-08-2013 12:25 PM
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.