08-17-2021 09:53 AM
I'm looking for information on how to create UI elements that the user can't see (or doesn't have access to) until the previous element has been successfully entered. If this isn't possible, just having the element greyed out until previous requirements are fulfilled would work too.
Thanks!
Jay
08-17-2021 10:07 AM
All controls and indicators have properties for disabled (enabled, disabled, disabled&greyed out) and visible(true/False). Just set them according to the current program state as needed using property nodes.
08-17-2021 10:19 AM
Would each UI element and corresponding property node need to be incapsulated in its own case structure/while loop?
Thanks!
Jay
08-17-2021 10:31 AM - edited 08-17-2021 10:35 AM
@JayWW wrote:
Would each UI element and corresponding property node need to be incapsulated in its own case structure/while loop?
I don't know what that even means (I don't know what a "case structure/while loop" is, for example. These are two very different things).. If you use a state machine architecture you just need to define what the user should see depending on state.
Property nodes only need to get written when their value changes, which is hopefully rare. No need to hammer them with the same property over and over in a greedy separate loop hammering the UI thread.
Have you done all the basic tutorials? At this point it would help if we could see some of your code to point you in the right direction. There are many other possible solutions. Another option would be to group controls according to state and place them on pages of a tab structure with hidden tabs. Then just switch tabs programmatically as needed.
08-17-2021 11:21 AM
Here is a very simple example that can potentially give you some ideas.
(Note that most architectural choices have a good reason. For example having the FOR loop before the event automatically ensures that the program starts up in a defined state. If there are many other events and timeouts, you can ensure that the property update only occurs as needed with a little bit more code)
08-17-2021 02:04 PM
Wow! It looks quite impressive for being "simple". I've gone through a few of the online training courses for Labview, but unfortunately I don't have enough time to fully immerse myself in the language to the point where I'm more self-sufficient.
Would you mind breaking down what's happening in your example? I appreciate it!
Jay
08-17-2021 03:18 PM - edited 08-17-2021 03:18 PM
After tinkering with the example VI you sent, I'm wondering is it possible to have more than one element that gets grayed out at a time? For example, if I had a text box for the user to enter a value and the Step 1 button?
Thanks!
Jay
08-17-2021 04:10 PM
Yes of course. I grey out more than one element already.
08-18-2021 07:58 AM - edited 08-18-2021 08:45 AM
I guess I'm asking how would you associate two or more elements to the same step? I'd like to have string inputs associated with boolean buttons so that the text box and button associated with each step are active together.
08-18-2021 08:51 AM
Well, you could create a 2D array of booleans with a row for each step and a column for each front panel element, then index into it with the state. Also don't forget my idea with the tab indicator. Just be creative!
Fortunately, LabVIEW is a full featured programming language and everything can be programmed with a little bit of effort.
Still, I strongly recommend to keep it simple and don't annoy the user with a huge number of micromanaged controls and overly complicated management of a huge pile of property nodes, making code maintenance difficult (herding cats!). You also need to ensure that all things properly reset when the program is started.