LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help making a control on the Front Panel for multiple inputs

Solved!
Go to solution

Hello!

So I am making a VI that will be used in testing something at multiple voltage values. Essentially I would like to have a control on the front panel that will allow the user to enter multiple voltage values that they wish to run the test with, that way they can run the test once instead of having to change the value and run the test multiple times. I'm not certain what control on the front panel would work best with having a varying number of inputs to it (between 1 and 6 different voltage values). I tried just a simple array but the issue with that is if you want to have 5 different values the first time and then only 3 the second time, there are still going to be 5 elements in the array from when you ran it the first time as opposed to 3. I really hope this is making sense, but I would really like something to where you can select the number of values you want to use and then simply type in each value or something along those lines.

 

Maybe I am just brain dead today, but I can't think of a way to do this so any help is appreciated!  

0 Kudos
Message 1 of 10
(4,470 Views)

Do you have an expected maximum number of inputs?

 

You could create a series of enums or rings.  Let one of the values in that list be None.

 

You could certainly create an array and have an input for number of inputs.  Use an event structure so that when ever there is a value change for the number of inputs, it Deletes the extra elements from the array or adds more default values to it.  You can change the number of elements shown and take away the index and scrollbar so there is no way a user could add more elements without actually using the #ofInputs control.

Message 2 of 10
(4,459 Views)

Yes the max number of inputs would be 6.

 

Ah I didn't think of programmatically deleting the extra elements in the array. I think I will try that out! Thanks!

 

0 Kudos
Message 3 of 10
(4,454 Views)

So maybe I am not doing this right, but I am deleting elements in the array by simply writing the correct array size to the local variable of that array. This leaves the correct number of boxes in the array un-grayed for the user to type in, but if they want, they can still input numbers into the gray boxes, thus adding an extra element. I would like to make this more dummy proof by making it so they can't add more values than what they specify. Is this possible? 

0 Kudos
Message 4 of 10
(4,442 Views)

Easy Way

Remove the array index display or any scrollbars, make the array a size of six, thus no more than six elements are visible or accessible at any one time.

Snap1.png

 

 

mcduff

0 Kudos
Message 5 of 10
(4,435 Views)

How did you make an array like that? 

0 Kudos
Message 6 of 10
(4,432 Views)

I made a cluster then "dropped" it into an array control.

 

Right-click the control and chose the visible items that you would like to hide, like scrollbar, index display, etc.

 

Snap2.png

 

mcduff

 

EDIT:

 

You can also make a six element cluster, this way your controls can have different names.

 

Snap3.png

Message 7 of 10
(4,429 Views)

Oh I see! Thank you!! 

0 Kudos
Message 8 of 10
(4,426 Views)
Solution
Accepted by topic author ebohannon

@ebohannon wrote:

So maybe I am not doing this right, but I am deleting elements in the array by simply writing the correct array size to the local variable of that array. This leaves the correct number of boxes in the array un-grayed for the user to type in, but if they want, they can still input numbers into the gray boxes, thus adding an extra element. I would like to make this more dummy proof by making it so they can't add more values than what they specify. Is this possible? 


Did you do the other part that I said where when you set the array to have a certain number of elements, you use the property node to show that number of elements?  Without a scrollbar and index, then there is no way

for a user to get to the unused elements to start typing stuff in and add more elements.

 

Example_VI

Message 9 of 10
(4,408 Views)

Well that's where I went wrong, I did not use that property node. Thank you for clarifying! Appreciate the help!

0 Kudos
Message 10 of 10
(4,326 Views)