LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing color shared variable

I am trying to create an LED or Color box that will change the color at the same instant between different vis within the project.  I have tried LED and changing the colour property but that only changes the properties within the one vi.  I have tried using shared variable but that seems to work for the true and false case for LED giving me two colors but I would ideally like more.  The color box shared variable seems to output the integer rather then the colour.

Is there away across different VI's to change the color(preferably choice out 4 colors) of either LED and/or Color box at the same time?

 

Thank you for any help in advance!

0 Kudos
Message 1 of 4
(2,464 Views)

Hello CJ18,

 

As you noted, the "value" of a color box is, in fact an integer representing the color.  It is the color box control or indicator itself that represents this value as a color. 

 

For reference:

 

KnowledgeBase 1Y77Q9BG: How Does a LabVIEW Color Box Interpret a Numeric Value for Color?

http://digital.ni.com/public.nsf/allkb/B61D723CC7B7BE4E862568F8004C3ACB

 

Wiring your integer shared variable to a color box indicator should work, or you can bind the indicator to the variable directly by right-clicking on it and selecting Properties>>Data Binding.

 

Regards,

Tom L.
Message 2 of 4
(2,454 Views)

If you are accessing the control's property accross VIs, you must have the reference of the control. So obtain the reference while executing the respective VIs and using the reference access the property of the control through VI server preoperties. If it is a color box then its just simply updating the values. Remember if you want to change the property of control/Color box the respective control must be in a running state so that you can see the change.

-----

The best solution is the one you find it by yourself
Message 3 of 4
(2,452 Views)

I am still getting used to LabVIEW and need to learn a little bit more about the referencing technique you are talking about.  I will definitely look in to it.  Using the indicator and binding technique it seems to work pretty well.

Thank you both for your help!

 

-CJ18

0 Kudos
Message 4 of 4
(2,437 Views)