Jump to content

Changing colour of LED


Recommended Posts

Im trying to change the colour of an led, depending on the number selected from a dial.

I'm using a case structure, with a property node linked to the LED, with the property BoolText.FGColor.

This should change the forecolor of the LED?

If i feed the property node a number representing a colour eg RRGGBB. On running the VI, an error is thrown.

I think its due to the way im trying to specify the colour. 'HELP' says it should be hexadecimal...

how do i do this?

Link to comment
Im trying to change the colour of an led, depending on the number selected from a dial.

I'm using a case structure, with a property node linked to the LED, with the property BoolText.FGColor.

This should change the forecolor of the LED?

If i feed the property node a number representing a colour eg RRGGBB. On running the VI, an error is thrown.

I think its due to the way im trying to specify the colour. 'HELP' says it should be hexadecimal...

how do i do this?

2816[/snapback]

If you want to change the color of the LED use the the property node 'Colors[4]'. It is an array with 4 clusters, each cluster containing two U32 numbers for the FG and BG colors. The first two elements are the colors of the ON and OFF state of the LED. The remaining two are probably for the transitional states of the BOOLEAN LED, you probably won't need them.

The BoolText.FGColor would change the FG color of the boolean text, but that is not writable in a running VI (go to the Context Help and click 'Click here for more help')

For the colors it is very convenient to use the 'Framed Color Box' (last item int the FP Numeric pallette) or the 'Color Box Constant' (first item in the BD 'Numeric--Additional Numeric Constants' pallette), since you can use the color selection dialog to select values.

Link to comment
  • 10 months later...
If you want to change the color of the LED use the the property node 'Colors[4]'. It is an array with 4 clusters, each cluster containing two U32 numbers for the FG and BG colors. The first two elements are the colors of the ON and OFF state of the LED. The remaining two are probably for the transitional states of the BOOLEAN LED, you probably won't need them.

What are theses "transitional states"?

Can I change the color of a blinking led? (eg. blink between green and red)

Link to comment
What are theses "transitional states"?

Can I change the color of a blinking led? (eg. blink between green and red)

You can pretty much ignore the transitional stats.

I was unable to get them to show on the front panel.

As for blinking you could put the color property node in a while loop and swap the colors around.

Download File:post-584-1130342239.vi

Link to comment
For the colors it is very convenient to use the 'Framed Color Box' (last item int the FP Numeric pallette) or the 'Color Box Constant' (first item in the BD 'Numeric--Additional Numeric Constants' pallette), since you can use the color selection dialog to select values.

nice! thanks for the tip regarding the COLOR BOX CONSTANTS!

i had it manually derived using the paint brush and then shown

its value to the numeric indicator

and then placed in a [4]array of cluster[2]..

whew!nice! color box constants! hehe

transitional states -

this is the FALSE to TRUE (LOW to HIGH in pulse)

or TRUE to FALSE (HIGH to LOW)

change of boolean values..

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.