09-09-2019 10:41 AM
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?
Solved! Go to Solution.
09-09-2019 11:02 AM
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/
09-09-2019 11:19 AM - edited 09-09-2019 11:19 AM
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.

09-09-2019 12:05 PM
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.
09-09-2019 12:09 PM
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.