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.
08-06-2020 10:37 AM
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!
08-06-2020 01:10 PM - edited 08-06-2020 01:18 PM
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.
08-06-2020 01:16 PM
@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.
08-06-2020 01:24 PM
@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.
08-06-2020 02:14 PM
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!
08-06-2020 02:17 PM
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.
08-06-2020 02:22 PM - edited 08-06-2020 02:24 PM
@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.
08-06-2020 02:37 PM
Also, unless you need to do something inside the Timeout event there is no need for a timeout on the event structure.
08-06-2020 02:46 PM
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!
08-07-2020 01:50 AM
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.)