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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UI with grayed out options until user enters required data

Hello!

 

I'm relatively new to LabView and I'm trying to create a front panel UI where the user selects from a drop down menu to pick a test to run, then enters specific data to populate the required test data. What I'd like to do is have data fields grayed out until the user enters data in the preceding data field.

 

 

 

I'm sure this is probably much more simple than I'm making it. I appreciate any help!

0 Kudos
Message 1 of 11
(1,523 Views)

Property nodes are what you are looking for. There is a property called disable, and you can change the enabled state of the control.

 

ETA event structure version as well. 

 

 

Download All
0 Kudos
Message 2 of 11
(1,483 Views)

@adekruif wrote:

Property nodes are what you are looking for. There is a property called disable, and you can change the enabled state of the control.

 

 


Adding to this, you can use a value change event on the control that's currently being written to and change the state of the next control inside that event.

0 Kudos
Message 3 of 11
(1,474 Views)

@johntrich1971 wrote:

@adekruif wrote:

Property nodes are what you are looking for. There is a property called disable, and you can change the enabled state of the control.

 

 


Adding to this, you can use a value change event on the control that's currently being written to and change the state of the next control inside that event.


The attached event structure does what johntrich1971 suggested.

0 Kudos
Message 4 of 11
(1,463 Views)

Thanks for the replies! So let's say there are 5 data elements in the UI that need to be sequentially entered. How would the piece of code illustrated in the attached image be sequenced to trigger the availability of the next UI element? (This may have already been answered, but I'm too new to know for sure. 😉

 

 

Thanks again!

0 Kudos
Message 5 of 11
(1,450 Views)

For value change events on a string control, you may want to set the property "update value while typing"; otherwise, a value change will only trigger when you enter text AND click off of that particular string control.

0 Kudos
Message 6 of 11
(1,448 Views)

@JayWW wrote:

Thanks for the replies! So let's say there are 5 data elements in the UI that need to be sequentially entered. How would the piece of code illustrated in the attached image be sequenced to trigger the availability of the next UI element? (This may have already been answered, but I'm too new to know for sure. 😉

 

 

Thanks again!


On program start make elements 2-5 grayed out, and element #1 enabled. Then, inside the even structure for element #1 you would include a property node for element #1 with a disabled constant as well as a property node for element #2 with an enabled constant. So on and so forth for all the elements you need.

0 Kudos
Message 7 of 11
(1,443 Views)

Also, unless you need to do something inside the Timeout event there is no need for a timeout on the event structure.

0 Kudos
Message 8 of 11
(1,433 Views)

One more question: In the initial drop down menu where the user selects which test to run, once a test is selected, how do I hide the UI for the other tests and only present the UI for the selected test? Create individual vi's for each test? Open a new window for each test?

 

Thanks!

0 Kudos
Message 9 of 11
(1,430 Views)

Hi Jay,

 


@JayWW wrote:

once a test is selected, how do I hide the UI for the other tests and only present the UI for the selected test? Create individual vi's for each test? Open a new window for each test?


Why are they all shown right from the beginning?

 

I would (probably) create a VI for each test. ("Probably" when the tests are very different. When they are very similar I would maybe create a QMH, which just executes several commands as needed.)

Then you just call the specific test VI, either as separate window or embedded in a subpanel. (See the LabVIEW options dialog as an inspiration for subpanel usage.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 11
(1,381 Views)