Jump to content

Enable/Disable & Show/Hide Controls


Kelly

Recommended Posts

I've had several VIs to hide and/or show and enable and/or disable controls and indicators on the front panel. After some discussion on Info-LabVIEW I cleaned them up and combined them. Here are two VIs. One will disable, disable & gray, or enable selected controls on the front panel of the VI it is used in. The other will hide or show (make invisible or visible) selected controls on the front panel of the VI it is used in. Documentation is on the front panel of these VIs as well as in the description of each control/indicator.Kelly Berschpost-15024-0-09707300-1352416824.jpgpost-11742-0-78664400-1352474562_thumb.pI should have included the fact that these VIs are for LabVIEW 8.2.Kelly

  • Like 1
Link to comment

QUOTE(kbersch @ Oct 30 2007, 11:19 PM)

I've had several VIs to hide and/or show and enable and/or disable controls and indicators on the front panel. After some discussion on Info-LabVIEW I cleaned them up and combined them. Here are two VIs. One will disable, disable & gray, or enable selected controls on the front panel of the VI it is used in. The other will hide or show (make invisible or visible) selected controls on the front panel of the VI it is used in. Documentation is on the front panel of these VIs as well as in the description of each control/indicator.Kelly Berschpost-15024-0-09707300-1352416824.jpgpost-11742-0-78664400-1352474562_thumb.pI should have included the fact that these VIs are for LabVIEW 8.2.Kelly

Nice Work!

Link to comment
  • 8 months later...

I've updated my Show/Hide and Enable/Disable controls VIs so they recursively find control refnums. This allows them to now find controls in Tabs and Clusters. You will need to make sure no two clusters/tabs have identically named controls or this will affect all of them.

There are two more VIs along with these because they are used in the recursive search. They are modified versions of the "Get controls on tabs.vi" written by Dave A. Graybeal. All four VIs need to be in the same folder. These VIs were written with LabVIEW 8.5.1.

Link to comment

QUOTE (kbersch @ Oct 30 2007, 06:19 PM)

I should have included the fact that these VIs are for LabVIEW 8.2.Kelly

Kelly,

I'd be interested in checking out your VIs, but I only go up to LV8.0. Any chance that you could save to 8 and post them?

Thanks.

Link to comment

Kelly, relying on control labels is something I generally find potentially dangerous. A more robust method would be using the control references directly. You can see a quick example here (in 7.1, if memory serves). In actual code, I would probably separate the action from the group input, but it shows the concept well enough.

Link to comment
  • 10 months later...

I don't want to burst your bubble on some of your code but you should checkout the VIs in

C:\Program Files\National Instruments\LabVIEW 8.6\vi.lib\Utility\traverseref.llb

there are two top level VIs that allow you to farm an array of all references of any type of LV object w/out worrying about traversing structures yourself.

In the end your code would still do the same thing, but be more robust and flexible for different types.

2009-06-08_1604.png

2009-06-08_1614.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.