From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

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

Solved!
Go to solution

@paul_cardinale wrote:

dc.png


Unfortunately, that only tells us it in a disable structure not whether or not its in a disabled case


"Should be" isn't "Is" -Jay
Message 11 of 20
(1,540 Views)

@Gregory wrote:

@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.


Yes, I think you are right! Sorry about that 🙂

0 Kudos
Message 12 of 20
(1,519 Views)
Solution
Accepted by SeanDonner

You guys are awesome.  The Terminal.Owner property is exactly the key I was looking for.  Although as rightly pointed out that this would filter terminals inside the 'Enabled' state of a Disable Diagram Structure, I'll take it!  I took the provided example by paul_cardinale and extended it such that it still filters out terminals inside a Disable Diagram structure even if they are nested within other structures.

 

Thanks to all of you that contributed to this question.

 Filter DD Controls.png

 


0 Kudos
Message 13 of 20
(1,508 Views)

Doh! I just realized this wont work for LabVIEW Exe's as VI Scripting nodes aren't available to the LV Runtime Engine.  Oh well, its still useful to non-EXE LabVIEW VI's that we talk to.


0 Kudos
Message 14 of 20
(1,498 Views)

@SeanDonner wrote:

Doh! I just realized this wont work for LabVIEW Exe's


Yep, I just wanted to write you this moment, scripting is a no go for builts 🙂

 

edit: i know it is some extra work, but I would just keep track of the references belonging to Disabled sections of the Block Diagram...The Bookmark Manager is very useful for this I think..

0 Kudos
Message 15 of 20
(1,496 Views)

While Blokk's solution is certainly an option, I would prefer to modify the "forbidden" controls Label - as already suggested by the OP -, for example appending a "-d".

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 16 of 20
(1,481 Views)

@pincpanter wrote:

While Blokk's solution is certainly an option, I would prefer to modify the "forbidden" controls Label - as already suggested by the OP -, for example appending a "-d".


Yes this would be fast and easy. Just a FOR loop and a Label.Text prop.node to filter out these objects...I could even imagine a Quick Drop plugin which automatically modifies these labels (appending a "-d") if we drop a Diagram Disable Structure around these controls. I am not sure if this is possible. If so, maybe there could be a "smart delete" feature for such Diagram Disable Structures, which automatically removes the appended "-d"-s...?

 

And this approach should not be a problem for the Front Panel, since Captions should be shown there, not Labels for the controls and indicators...

Message 17 of 20
(1,471 Views)

Some scripting nodes work in the Run-Time Engine.  Lucky for you, this is one of them.

 

Example.png

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 18 of 20
(1,436 Views)

Hah, score! I should have dug in deeper and went into the Detailed Help.   I used context help to hover over the 'Terminal' property node and it said it wasn't supported so I assumed that applied to its sub-properties as well.

 

lv_term_help.png


0 Kudos
Message 19 of 20
(1,426 Views)

Try it and let us know what happens.

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 20 of 20
(1,422 Views)