From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-02-2017 11:06 PM
I'm wondering how to do this in labview.I can't find a tutorial. If user enters a number lets say 7, then press a button then array with size of 7 is created . I tried with loop function but it didnt work
Solved! Go to Solution.
06-03-2017 12:02 AM
06-03-2017 11:51 AM
This is what I did too but I need to drag the array manual to see it. Is there a way that once you press the button it shows it. Also, currently my array type is an indicator so the value is what I put for initilizing . Is there a way once the user pressed the button, array is created. then user manual enters the values he wants .See the attached file. So he enters 5 for intervals, then an array of size 5 is created. then he enters 3,6,9,1,2 in the array
06-03-2017 12:42 PM
There is a property for setting the number of elements visible for an array control/indicator. Right click on your array and create->property node. I do not remember the exact name, but it will be obvious.
And if you want the user to edit the value, it needs to be a control.
06-04-2017 06:13 PM
@Canucks.canucks wrote:
This is what I did too but I need to drag the array manual to see it. Is there a way that once you press the button it shows it. Also, currently my array type is an indicator so the value is what I put for initilizing . Is there a way once the user pressed the button, array is created. then user manual enters the values he wants .See the attached file. So he enters 5 for intervals, then an array of size 5 is created. then he enters 3,6,9,1,2 in the array
You're trying to solve two different problems.
1) Create an array of size n
2) Display all values of the array
The first you're doing already. The display doesn't change the data contained in the array. If you can drag it to see the values, you've made the array.
The second, you'll want to take some time to think about before implementing. crossrulz gave you the answer. But, you'll want to think about what this CAN do. If the user hits 5, no big deal. If they hit 10, probably not a big deal. What if they hit 100? Do you want your VI stretching that far? Often, it's a better decision to choose your max viewable length and let the user see the uninitialized values. If you do want it to grow, you'll want to determine a max size and add some logic to prevent the array from displaying any more than that number of elements.