LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV OOP for an alternative to clusters?

Solved!
Go to solution

I'm modifying some code having a large number of Boolean indicators, all of them blinking when data is invalid. I need to eliminate the blinkers. I'm faced with making many changes to existing property nodes, changing "Blinking" to  "Colors[]".

 

I don't want to move the Booleans to a cluster because of the magnitude of rework required to decode the data. I'm looking for an alternative to clusters that would allow me to change the color scheme for many Booleans with very little code. I don't see a Controls[] class for subPanels.

 

If LV OOP offers a solution to my problem, where should I go to learn the basics at little or no cost?

 

Thanks,

 

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 1 of 7
(3,315 Views)

LVOOP is almost certainly not a solution to a problem involving visible controls.  One of the core aspects of LVOOP is that you can't see the data inside them directly.  If you put a LVOOP control on the front panel, all you'll see is the 32x32 icon for the default class icon.

 

How many different controls are you having to change code for?  10?  100?  1000?  All on one main panel or spread across many SubVIs?

0 Kudos
Message 2 of 7
(3,306 Views)

How many different controls are you having to change code for?  10?  100?  1000?  All on one main panel or spread across many SubVIs?

 

Estimate 3 thousand Boolean indicators, spread across several VIs. In four VIs, hundreds were in tab controls. Because the indicators that were on each page of the tab control had a common data validity signal, I used properties of the tab control to change all their color schemes.

 

In the VI I'm looking at now, I could use a tab control for that majority of Booleans with a common validity signal, then position the few other few Booleans adjacent to the tab control. Not my favorite option.

 

I was hoping for a technique where I could select a group of indicators and make them part of an object or class, so their location on the front panel wouldn't be constrained by the location and size of a physical container.

 

I enabled scripting but haven't figured out how to use it for changing large numbers of property nodes, replace indicators, etc.

 

Thanks,

 

 

 


 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 3 of 7
(3,260 Views)

Yes, scripting is where you want to start.  Enabling it should have added a new visible palette inside the "Application Control" palette called "VI Scripting", as well as showing a lot more property nodes for things like controls and VIs.  In the "VI Scripting" palette, you can find a VI called "Traverse for GObjects", which will search an entire VI (including objects nested in other objects) for anything that matches the class name you pass in ("Control" would work, but would return every single control in the VI, so you may want to search for "Boolean" instead).  

 

You'll want to typecast those down to a Boolean object to unlock all of the relevant property nodes, and then it'll be a matter of just finding the right series of filters to determine which controls you'll want to change, and then what nodes to set to what values to see the change you want.  Try it on one VI, then if it makes everything the way you want it you can run it on the rest of them.

 

0 Kudos
Message 4 of 7
(3,232 Views)

@MinerHokieRamp wrote:

I'm looking for an alternative to clusters that would allow me to change the color scheme for many Booleans with very little code. I don't see a Controls[] class for subPanels. 

 


Well, yes, you really couldn't now could you?  The vi only kvows that there is a sub panel and if a vi is loaded into it.  It knows noting about the content of the subpanel.  On the other hand, you DO have a vi server referance to the sub-vi that you loaded into the sub-panel.Smiley Wink  That vi ref is the one that you want to optain control[] refs for or traverse with Boolean filter for the control[]refs.


"Should be" isn't "Is" -Jay
Message 5 of 7
(3,221 Views)

@JÞB wrote:

@MinerHokieRamp wrote:

I'm looking for an alternative to clusters that would allow me to change the color scheme for many Booleans with very little code. I don't see a Controls[] class for subPanels. 

 


Well, yes, you really couldn't now could you?  The vi only kvows that there is a sub panel and if a vi is loaded into it.  It knows noting about the content of the subpanel.  On the other hand, you DO have a vi server referance to the sub-vi that you loaded into the sub-panel.Smiley Wink  That vi ref is the one that you want to optain control[] refs for or traverse with Boolean filter for the control[]refs.


I was hoping for a technique where I could select a group of indicators and make them part of an object or class, so their location on the front panel wouldn't be constrained by the location and size of a physical container.

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 6 of 7
(3,189 Views)
Solution
Accepted by topic author MinerHokieRamp

Solution: I manually changed many property nodes.

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 7 of 7
(3,123 Views)