LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mass Hide/Unhide Controls

Solved!
Go to solution

I have a bit of a quandary and I'm looking for some advice, or if possible - best practice on what I've attempted to achieve here.

This does work - but I'm not happy with how untidy it is.  I have a set of controls and indicators that I want to hide and unhide during the State Machine.

 

My solution was to create a SubVI that would loop through an array of control/indicator References and hide/unhide as per the Boolean input.  My issue is that I now have that many to hide/unhide, it's become on huge pile of References being fed into an array.

JasonWilliams_0-1580474632672.png

Is there any better way to achieve this?  Sometimes I overlook the simple and end up at the most complicated solution!

0 Kudos
Message 1 of 8
(3,133 Views)

Hi Jason,

 

options:

  • place all controls/indicators in a cluster and just (un)hide that cluster…
  • get all control references by reading a property of the VI frontpanel…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,122 Views)

Thanks for the suggestions, I will investigate both and see which is the best for what I'm trying to achieve.

0 Kudos
Message 3 of 8
(3,108 Views)

Hi Jason,

 

the 2nd option can be expanded by filtering the control references by their label (or other properties)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(3,097 Views)
Solution
Accepted by topic author JasonWilliams

If all of the controls/indicators are together on the front panel, you could put them on a tab control. One tab would have the controls and a second tab without them. Then, hide the tabs themselves (so your user can't get to the wrong one) and when you change tabs programmatically, the controls will be visible or hidden - then there is only one thing to update.

Message 5 of 8
(3,041 Views)

If we're on alternative problems, and your setup has various groups of controls of which only one needs to be visible at a time, you could consider calling VIs by reference, wiring an Event reference or queue to them, and then embedding them in a subpanel and changing the VI that the subpanel contains with changing states in your state machine.

 

Not sure that describes your application at all, but perhaps it could...


GCentral
0 Kudos
Message 6 of 8
(3,036 Views)

That is a LOT of controls to be hiding and unhiding. I'd think either a tab control or subpanels would be a better solution. With the tab control you can even hide the tabs and control which set of controls/indicators are visible programmatically.

 

Another option that I really like is to bundle all of the references for all of the controls you want to show or hide into a shift register, along with your other "local" data (like settings, VISA references, whatever). Have a subVI that you can call with a "mode" selector, like "Idle", "Testing", "Test error", etc. Within the subVI, unbundle the references and wire them to FOR loops for which ones you want to enable/disable & gray/turn invisible/etc.

 

This is much more expandable than creating new references each time.

0 Kudos
Message 7 of 8
(3,022 Views)

Every time I return to a project I'm working on I end up finding new functions I haven't explored yet and realise they are a perfect solution to the problem I have.  

 

I've accepted the solution of Tabs as this works perfectly for the scenario I'm in, essentially a panel showing controls only required at the point of data capture.  I do have a several controls which need to be hidden/unhidden on that tab but much more manageable that my original method.

 

Many thanks everyone to the suggestions - I have also looked into Sub Panels which I've not yet used, I just felt Tabs were the easiest solution to my problem.

0 Kudos
Message 8 of 8
(2,764 Views)