LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-indexing array with changing size

Solved!
Go to solution

I want to make a for loop that generates an array of numbers using the auto-indexing function. I want the user of the program to be able to change the number of times the for loop is run and therefore the number of values in the array. I want the array to be displayed in the VI. I seem to have to manually specify how many elements the indicator array has by dragging down the numerical indicator array in the VI. Is there a way to set the array to have a number of elements equal to the number of times the for loop is run?

0 Kudos
Message 1 of 5
(3,761 Views)
Solution
Accepted by topic author ef99

I would suggest showing a reasonable amount of elements (whatever fits will in your UI) and then making the vertical/horizontal scrollbar visible. You can change the number of visible columns/rows but displaying information this way doesn't scale well if you think of having hundreds of elements.

 

https://zone.ni.com/reference/en-XX/help/371361R-01/lvprop/array_p/

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 5
(3,747 Views)

That is purely a cosmetic issue, not a value issue.  But you can set the number of rows to display by using a property node.



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 3 of 5
(3,731 Views)

As others have said, the number of elements shown is completely independent of the array size. I would also recommend to just show the scrollbars. Changing the number of elements shown is typically not a good idea. If there is sufficient space, you might as well show all that fits. If there is insufficient space, resizing causes overlap. And if your program doesn't do sanity checks, you might get an array with millions of elements shown, blowing up your front panel.

0 Kudos
Message 4 of 5
(3,706 Views)

Unless the array is also required as output connector, you could format it as multiline string or table for a more compact and pleasing visual.

0 Kudos
Message 5 of 5
(3,705 Views)