LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get static reference to decoration

Solved!
Go to solution

Is there any way to get a static reference to a decoration? I have some pipes that are represented by colored decorations that I wish to change the colors of them based on the data I receive. I know it is possible to get references to decorations in a programmatic way, but that is a huge maintainability problem since it makes it incredibly difficult to follow the program flow. Thanks.

0 Kudos
Message 1 of 6
(3,589 Views)
Solution
Accepted by topic author KeenanJohnson

I do not think you can get that directly. Check the Idea Exchange. I think there have been some proposals along that line.

 

Perhaps an alternative approach would be to put color box indicators behind the decorations and change the color of those. The borders of your pipe decorations would be opaque while the interiors would be transparent to allow the color boxes to show through. The color boxes show up as standard terminals on the block diagram. With appropriate labels they fit perfectly into the dataflow paradigm.

 

Lynn

Message 2 of 6
(3,584 Views)

As Lynn suggested, there is already an idea for this in the IE, and if you find it, you will also find a link to do something like this using tags.

 

That said, I agree with his suggestion in this case and would take it even a step further - use only color box controls. You should be able to customize them using the control editor to do quite a few things. If you have a lot of them, I would suggest putting them in a cluster and writing code which will automatically get their references and actually change their colors (value) based on their labels. You will probably find it easier and cleaner than controlling each one directly.


___________________
Try to take over the world!
0 Kudos
Message 3 of 6
(3,561 Views)

What do you mean precisely with "it makes it incredibly difficult to follow the program flow"?

You may store the references into a LV2 global type vi in the initialization step. Then it would be easy to use them without having too much wires around.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 6
(3,551 Views)

@tst wrote:

As Lynn suggested, there is already an idea for this in the IE, and if you find it, you will also find a link to do something like this using tags.

 

That said, I agree with his suggestion in this case and would take it even a step further - use only color box controls. You should be able to customize them using the control editor to do quite a few things. If you have a lot of them, I would suggest putting them in a cluster and writing code which will automatically get their references and actually change their colors (value) based on their labels. You will probably find it easier and cleaner than controlling each one directly.


Very sound advice. as I learned to my horror here.  and was directed here for help customizing the controls I eventually used easilly.  (saving about a forest's worth of BD space as well)


"Should be" isn't "Is" -Jay
Message 5 of 6
(3,530 Views)
0 Kudos
Message 6 of 6
(3,517 Views)