05-04-2010 01:18 PM
I know the question of updating an indicator on a top-level VI from a sub-VI has been asked before on the discussion board, but my question is slightly different because I want to update the property of an indicator, not necessarily its value.
In my top-level VI I have a cluster which contains some string indicators. The cluster is a typedef.
I want to change the background color of the string indicator to red or green from my sub-VI so that it looks like this:
Creating a reference to the cluster and passing it to the sub-VI doesn't seem to work. I'm not able to see the Text.BGColor property to change the background color of the string indicators:
It seems like creating a reference to a string indicator and passing it to the sub-VI might work like this:
Is there a better/more elegant way to do this? Do I have to create a string reference for each string in my cluster and pass it to my sub-VI?
I messed around with global variables, but no luck.
Plese help.
Solved! Go to Solution.
05-04-2010 01:25 PM
what I think you left out in that question is the step where you take the cluster ref and get the refs to the objects inside the cluster. Since there is more than one and cluster allow different data types, the refs from the cluster ref are generic and the property you are looking for is specific to the strings.
So what you need is the "To more specific" node along with a constant ref for a string and you should be good to go.
I wrote about this idea in my Nugget on Exploiting Control References where I discover at run time the definition of the cluster. Don't worry about reading and understanding everything in that nugget. Just read enough to figure out what need to change in your code.
Ben
05-04-2010 01:28 PM
05-04-2010 02:18 PM
Thanks. Your solutions worked. Here's the working sub-VI:
06-23-2015 05:13 PM
Hey,
I'd really like to do what you have shown in the 2nd image where you have the Numeric Indicator changing colour dependant on value. I'd like to create a NUmeric Indicator that is green if a value is in spec. or red if it is outside of spec.
Please can you tell me in laymans terms how to do this? I'm a somewhat beginner on LabVIEW anyways.
Thanks
Craig
06-23-2015 05:35 PM - edited 06-23-2015 05:35 PM
@RotoMoto wrote:
Hey,
I'd really like to do what you have shown in the 2nd image where you have the Numeric Indicator changing colour dependant on value. I'd like to create a NUmeric Indicator that is green if a value is in spec. or red if it is outside of spec.
Please can you tell me in laymans terms how to do this? I'm a somewhat beginner on LabVIEW anyways.
Thanks
Craig
How about this? Background is green when the number is between 90 and 100, otherwise red.
06-23-2015 06:02 PM
Looks perfect, thanks, though I'm not sure where I find each of the functions used?
Sorry total layman at the moment.
06-24-2015 09:24 AM - edited 06-24-2015 09:26 AM
They are in the functions palette
I hope you know how to create a numeric control (x) and the numeric constantans
In Range and Coerce is in Functions--->Comparison
Select is also in Functoins--->Comparison
The Color Box Constant is in Functions--->Dialog and User Interface
The NumText.BGColor Property Node is created y right clicking on the numeric control terminal on the block diagram and from the popup menu select
Create--->Property Node--->Numeric Text--->Colors--->BG Color
Then right click on the Property Node and select Change All To Write
06-24-2015 01:27 PM
That worked perfectly! Thanks a lot.
Craig