07-03-2013 01:01 PM
Hello,
I have 20 analog voltage inputs and I want their corresponding numeric indicators to change color according to their value. The only way I know how to do this would be to do 20 case structures with 20 property nodes (one for each numeric indicator). Can someone please suggest to me a better way to do this?
Thanks in advance,
Cassidee
07-03-2013 01:13 PM - edited 07-03-2013 01:18 PM
Use a table indicator with a single row or column, then color the cell backgrounds according to the values.
(Here is a 2D example, so your problem is even simpler.)
07-03-2013 01:24 PM
Sorry, but that doesn't answer my question. My configuration for the analog inputs are not all located in a single nicely formatted little table. They are each positioned individually. Is there any way to do this using the numeric indicators and not a table indicator?
07-03-2013 01:36 PM
Do your indicators have captions?
You can probably find a better way to differentiate one numeric indicator from the next, but I added captions to all of mine and, for the ones I wanted to modify, their caption was "CCC".
My numeric indicators did not have a color property I could influence so I used blinking instead...
Just an idea.
07-03-2013 01:44 PM
Thanks for your input, but unfortunately I need to change the background of the numeric indicator not the caption.
07-03-2013 01:50 PM
Use a color ramp, or a numeric indicator with a scale that has a color ramp.
07-03-2013 01:52 PM
Soooo... replace the blinking property node with a background node?
The caption is only to tell the difference between the numeric indicators you want to change and everything else you do not.
Like I said there is probably a better way to detect them but I have not thought of one yet.
07-03-2013 02:00 PM - edited 07-03-2013 02:14 PM
@cassidee21 wrote:
Sorry, but that doesn't answer my question. My configuration for the analog inputs are not all located in a single nicely formatted little table. They are each positioned individually. Is there any way to do this using the numeric indicators and not a table indicator?
Well, it answered based on the very limited information of your original question. Now that we have more information, we can refine the answer. 😄 I also did not understand the need for case structures.
Many times, combining related indicators into an array or table are a great way to simplify the front panel and associated code. If this is early in development and you have some design flexibility, you might want to rethink the layout. 😄
Another way would be to use an explicit array of references, then simply loop over them.
Here's a quick example with three indicators. Of course you would probably want to use a fancier color lookup table and a different mapping into it, depending on your needs.
07-03-2013 02:00 PM
This problem has XControl written all over it. Make one and then sprinkle them all over your FP as desired.
07-03-2013 04:20 PM
Hi Cassidee,
I sugest using Altenbach's method with an Action Engine. The Action Engine can be used wherever it's needed.
Attached is an example in LV2010 with code to test it included.
The action engine is called Numeric AE.vi and contains just two states:
Note that "Num Action" is type defed and the "Init" entry is the last one so we can easily index the correct reference.
steve