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: 

Visable Property Node Question

Solved!
Go to solution

I need to make different controls on my front panel appear and disapper with depending on what is being done is there an easy way to make a lot of different things appear and disappear without creating a property node for each individual one. Its slowing me down a bit during execution and its also making my primary VI huge.

0 Kudos
Message 1 of 12
(2,827 Views)
Solution
Accepted by topic author Throggdor

Try creating an array of references for the things you want to make visible/invisible, then pass that array into a for loop with a property node inside. This should save you plenty of block diagram space.

 

like so:

 Capture.PNG

Message 2 of 12
(2,826 Views)

@Phil_ wrote:

Try creating an array of references for the things you want to make visible/invisible, then pass that array into a for loop with a property node inside. This should save you plenty of block diagram space.

 

like so:

 Capture.PNG


I learned that trick from cross.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 12
(2,808 Views)
If the controls are close to each other and they should appear/disappear together, you can put them in a cluster. Now you only need a property node for the cluster.
Message 4 of 12
(2,804 Views)

Or, if you have set conditions for which different combinations of things are made in/visible, you could use an enum for your conditions and choose the individual actions for each in a case statement. In the example below, I was switching between "Enabled" and "Disabled and Grayed Out" states to let the user know which controls s/he could adjust in the area of the program s/he was currently. I apologize in advance for using a picture, but the VI I'm taking it from (the instrument configuration panel) would be a real pain to disassemble enough to give code (there are 40 or so controls that I'm manipulating). The other "Modes" have different combinations of enabled/disabled conrols.

 

 

enum_example.png

 

 

It can get big, but you're just talking about a single column. If there are significant groups of objects which always are switched together (I wasn't that lucky), then you can also bundle them to make the column shorter, as Phil_ said.

 

Cameron

 

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
Message 5 of 12
(2,800 Views)

@Phil_ wrote:Capture.PNG

If you are dealing with more than just a few controls/indicators, I would recommend setting Defer Front Panel Updates before the FOR loop and clear it after.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 12
(2,785 Views)

Another bit of advice is that if you have a set group of controls/indicators which are grouped together on the front panel, and will always be visible/hiddent as a group, place them in a cluster and simply make the cluster visible/hidden.  This of course only applies to this unique situation.  The other responses are useful for more general applications.

 

you can also make the cluster invisible to the user by making it's borders transparent.

 

Message 7 of 12
(2,773 Views)

If you are dealing with more than just a few controls/indicators, I would recommend setting Defer Front Panel Updates before the FOR loop and clear it after.


Please forgive my ignorance, but what is the advantage of doing this?

0 Kudos
Message 8 of 12
(2,760 Views)

Every time you change the property of a control, the processor takes time to update the front panel.  So if you were to hide 50 controls, it would update the front panel 50 times.  This can be time consuming and slow down your code.  Defering the update until the end saves processing time.

Message 9 of 12
(2,758 Views)

Wow I am really impressed with the amount of feedback I got for this question. Ultimitly I am going to go with creating clusters and the for loop both of which were suggested above; since when all is said and done I have about 10 clusters that I need to make appear and disappear. Thanks for all the help Kudos all around lol.

0 Kudos
Message 10 of 12
(2,742 Views)