LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to batch disable the controls

In a lot of occassions of my program, I need to disable more than 20 controls and enable them later. Is there a way to disable/enable them in a shot so that I won't need to do that one by one? How about locking out the whole front panel?
0 Kudos
Message 1 of 10
(3,371 Views)
Hi,
For this you will have to create a cluster of all your controls.and play around with your cluster property to ENABLE and DISABLE the controls.
vicky
0 Kudos
Message 2 of 10
(3,370 Views)
You can get the refs of all the vi controls in two steps : ask first for a reference to the front panel, then for the refs of all the controls/indicators.
Then you will be able to enable or disable all the controls at once.
See the attached example (where there is something wrong... will you find what ?)
Have fun... 🙂
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 3 of 10
(3,371 Views)
" (where there is something wrong... will you find what ?)
"

Are you talking about the disable control getting disabled?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 10
(3,370 Views)
So easy ! You got half a voucher for a beer ! (not the same as a voucher for half a beer...)

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 5 of 10
(3,370 Views)
At the start of your program, create a control reference for each of the
controls that you want to disable in a single go. Build all the references
into an array and then pass the array into a 'for loop' which has a property
node within it that sets the disabled/enabled state. If you then select only
the 'for loop' and convert it into a subVI, you can use this anywhere in
your program to easily disable/enable the controls. All you need to wire
into the subVI when you call it, is a local variable connected to the array
of control references you created, and a constant that sets the value of the
property node inside the subVI.

This gives you a handy way to do what you want, you can also build arrays of
different controls, so that you can disable or enable groups of bu
ttons.
The best way yet is to put all your controls into a cluster, then create a
property node for the cluster. One of the properties of the cluster is the
'Controls[]' property which is effectively the same thing as the array I
mentioned before. but without you having to create loads of control
references manually!

Regards,
Dave.

"terp" wrote in message
news:50650000000800000015010100-1079395200000@exchange.ni.com...
> In a lot of occassions of my program, I need to disable more than 20
> controls and enable them later. Is there a way to disable/enable them
> in a shot so that I won't need to do that one by one? How about
> locking out the whole front panel?
0 Kudos
Message 6 of 10
(3,371 Views)
terp wrote in message news:<50650000000800000015010100-1079395200000@exchange.ni.com>...
> In a lot of occassions of my program, I need to disable more than 20
> controls and enable them later. Is there a way to disable/enable them
> in a shot so that I won't need to do that one by one? How about
> locking out the whole front panel?

One way is to put the controls in a cluster, then you can simply
enable/disable the cluster.
0 Kudos
Message 7 of 10
(3,369 Views)
You guys are the best. They all work. But I think Chilly Charly's solution fits my need the most. Thanks!
0 Kudos
Message 8 of 10
(3,366 Views)
I have the same requirement in my application - about 2 dozen controls to enable/disable programmatically.  How do I make the cluster completely invisible while keeping the controls in the cluster visible?  I set the background color of the cluster to transparent.  However, I can still see the beveled edges of the cluster.
0 Kudos
Message 9 of 10
(3,170 Views)

Les Bartel wrote:
... How do I make the cluster completely invisible while keeping the controls in the cluster visible?  I set the background color of the cluster to transparent.  However, I can still see the beveled edges of the cluster.

This KnowledgeBase item should help:

Visibility of Control \ Incidator \ Cluster Border in LabVIEW

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 10 of 10
(3,154 Views)