LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating UI elements that are invisible until preceding UI elements are entered

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

0 Kudos
Message 1 of 14
(2,004 Views)

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.

0 Kudos
Message 2 of 14
(1,999 Views)

Would each UI element and corresponding property node need to be incapsulated in its own case structure/while loop?

 

Thanks!

 

Jay

0 Kudos
Message 3 of 14
(1,994 Views)

@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.

0 Kudos
Message 4 of 14
(1,988 Views)

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)

 

 

altenbach_0-1629217101742.png

 

Message 5 of 14
(1,975 Views)

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

0 Kudos
Message 6 of 14
(1,954 Views)

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

0 Kudos
Message 7 of 14
(1,934 Views)

Yes of course. I grey out more than one element already.

0 Kudos
Message 8 of 14
(1,917 Views)

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.

JayWW_0-1629294348193.png

 

0 Kudos
Message 9 of 14
(1,863 Views)

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.

 

 

0 Kudos
Message 10 of 14
(1,852 Views)