LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter out references to controls inside a disable diagram structure?

Solved!
Go to solution

If I use the Controls[] property from a Front Panel reference it will give me an array of references for all controls regardless if they are within a disable diagram structure or not.  Is there a programmatic way for me to filter out any control references that are within a disable diagram structure? 


0 Kudos
Message 1 of 20
(2,510 Views)

Are you talking about controls?  Or are you talking about the terminal for a control located on the block diagram?

0 Kudos
Message 2 of 20
(2,480 Views)

Even if a terminal is within a disable structure, its control still lives on the FP.

You can for example create a property node for that control outside the disable structure.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
Message 3 of 20
(2,461 Views)

I cannot help you, but I suggest a kind of workaround. Whenever you disable objects in the BD, select them all, and set them to "Disabled" or "Disabled & Gray". This is an extra step, but after this setting, you can easily filter out your disabled controls. You might get problem however, if you use the Disabled setting (either static way or programmatically) for controls in your code which are not inside a Disable Structure.

 

So maybe a better practice can be the following. Whenever you put a Diagram Disable Structure in your bock diagram, highlight/select all objects inside, then right click, and go to "Create Reference". Then you get all the references for those objects which are inside the diagram disable structure (actually there are special ). You can keep these references in a convenient "place", either in your main VI BD, or in a FGV, or in a Global Variable, depends on your requirements. I would also use the Bookmark manager (#description, View -> Bookmark manager), so you keep track of all the changes you made, where are your Diagram Disable Structures in your code, and what references are there. All depends on your personal taste or coding style...

 

Another thing which can make things easier: start to use Quick Drop shortcuts! They are very cool, try it, for example at a step above when you created all the references, you would like to bundle them or put them into an array, using the Build Array function. If you have lots of references, it would take too much time, but using these QuickDrop shortcuts, life is easier 🙂

Wire Multiple Objects Together (Ctrl-Space, then -Ctrl-W)

https://forums.ni.com/t5/Quick-Drop-Enthusiasts/Introduction-to-Quick-Drop/gpm-p/3531307

 

filterrefs.png

 

 

 

Message 4 of 20
(2,451 Views)

I guess to be semantically correct I'm talking about the terminals on the block diagram of which is the only thing you can place a disable diagram structure around.  The property I'm referring to is the Controls[] property from a Front Panel reference as shown in @Blokk's diagram above.

 

To put a bit more context and motivation behind my question, we have another piece of software that communicates with our LabVIEW executables using the ActiveX engine.  When we build the LabVIEW EXE we link in another VI which is introspective into the main VI and provides a list of all the controls/indicators on the front panel along with their data type so the other software has the info it needs to Set/Get the LabVIEW controls over ActiveX.

 

I was hoping there would be a programmatic way for that linked in introspective VI to ignore/filter out the terminals on the main VI that are within a disable diagram structure.  I didn't see anything on the property node that seemed to fit the bill and I was hoping there was either some hidden property that is not normally exposed to glean this info or some round-a-about way to get that info.  I did think about the possibility of using the 'Disabled' property as a way to key off of but that definitely would hide controls we still want to expose.  

 

Ideally there would be a built-in way to key off of terminals that are in a disable diagram structure but if not, creating/using a quick-drop shortcut that would modify the label or caption with a unique identify that the introspective VI would key off of could certainly work!


0 Kudos
Message 5 of 20
(2,422 Views)

  I did think about the possibility of using the 'Disabled' property as a way to key off of but that definitely would hide controls we still want to expose.  

 

Not true. If you disable (and not Disable & grayed out) a control/indicator, it will just look the same! The only thing is that, the user cannot interact with the control. But if we are talking about an indicator, nothing changes what the user would notice, and it will even show live data if you update it!

But this is actually not clear to me: if you put objects into a Diagram Disable Structure, why you want to show them to the user? Such controls will not output any data, such indicators will not update! So actually you could just Hide these objects from the Front Panel, and filter out these references from the full array using the "Visible" Property node...


0 Kudos
Message 6 of 20
(2,376 Views)

  I did think about the possibility of using the 'Disabled' property as a way to key off of but that definitely would hide controls we still want to expose.  

 

Not true. If you disable (and not Disable & grayed out) a control/indicator, it will just look the same! The only thing is that, the user cannot interact with the control. But if we are talking about an indicator, nothing changes what the user would notice, and it will even show live data if you update it!

But this is actually not clear to me: if you put objects into a Diagram Disable Structure, why you want to show them to the user? Such controls will not output any data, such indicators will not update! So actually you could just Hide these objects from the Front Panel, and filter out these references from the full array using the "Visible" Property node...

0 Kudos
Message 7 of 20
(2,410 Views)

try looking at the owning object of each control...  If it's in a disabled structure, I imagine  that should show up as the owner.  Now you do run into problem if it is inside a case structure inside a disabled structure...

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 8 of 20
(2,400 Views)

dc.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 9 of 20
(2,395 Views)

@Blokk wrote:

  I did think about the possibility of using the 'Disabled' property as a way to key off of but that definitely would hide controls we still want to expose.  

 

Not true. If you disable (and not Disable & grayed out) a control/indicator, it will just look the same! 


Blokk, I think he means that the other VI is going to "show" most of the controls but "hide" the ones he doesn't want to expose. Using the disabled property would hide more controls than he wants to hide.

0 Kudos
Message 10 of 20
(2,386 Views)