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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling Front Panel Controls

Solved!
Go to solution

Hello,

 

Currently I am working on trying to disable/gray out between 10-20 front panel controls when a start button is pressed, and then enabling them at the completion of the test. Currently I am using property nodes which all are wired to a constant of which state I want which works perfectly. My question lies with there being another way other than having a bunch of property nodes filling up my event structure. Ive read where people had subVI's that used references to do this same function, but is there a way to do this right in the block diagram of my current VI? Thank you!

0 Kudos
Message 1 of 12
(4,473 Views)

I like to use it wrapped inside a subVI, but you can of course have it in the BD of the main VI, have a look at this example:

 

Control_ref_example.png

Message 2 of 12
(4,459 Views)

not to be a hassle, but I am currently working in 2010 so I can't open your VI.

0 Kudos
Message 3 of 12
(4,445 Views)
Solution
Accepted by topic author Zzimmha42

So you have to create references of your front panel controls, this can be quick, since you can select multiple, and with right click you create references.

I have attached a version LV2010.

 

edit: another advice:

You have to create only once these references. Usually it is comfortable to bundle all the references into a cluster, and use this wire through your whole code. In this way you can just unbundle those references which at the actual location you need to play with, put them into an array, and use the above FOR loop to change their properties...

Like this:

 

refnums_enable_example-4_BD.png

0 Kudos
Message 4 of 12
(4,436 Views)

Also if you feel like getting the references by name you can use the Traverse for GObjects, or Find Objects by Label in the vi.lib or installed with the Hidden Gems package.

0 Kudos
Message 5 of 12
(4,396 Views)

what if I had a "1000" controls to disbled? instead of individually doing each one, as suggested:

Controls FP_disable_BD.png

Message 6 of 12
(4,394 Views)

Ive tried your solution, still takes up a bit of space but is much cleaner than using a bunch of property nodes. Thank you Blokk!

0 Kudos
Message 7 of 12
(4,385 Views)

Apok,

 

I like your solution bc I'm not a fan of disabling each control individually, but my only question is lets say I have 20 controls, but only want to disable 15 of those 20, is that possible with your setup?

0 Kudos
Message 8 of 12
(4,378 Views)

No, Apok's solution will act on ALL controls. Use my solution for selective manipulation. I mean the solution with Bundle to cluster and Unbundle by name + build array...

And use a subVI to save space on your BD!

See attachment...

0 Kudos
Message 9 of 12
(4,370 Views)

ups, I forgot to add the usual Error case as it should have like other subVIs, see the revised version.

0 Kudos
Message 10 of 12
(4,343 Views)