06-09-2011 04:17 PM
Hi,
I don't know how to exactly explain my problem but I'll try:)
I want to get colors of multiple plots and show them next to buttons that switch on/off selected signals.
For example I have 4 signals: sine, square, saw, triangle, so when all of them are switched on:
signal - color
sine - white
square - red
saw - green
triangle - blue
but when I switch off square wave:
sine - white
square (which is switched of) - red
saw - green
triangle - black (default color)
and should be:
sine - white
square (which is switched of) - black
saw - red
triangle - green
I tried to do it but I don't know how:( can anyone help me? any solutions?
I attached my vi's - LV 2010 and 8.6(zip)
Regards
Mike
Solved! Go to Solution.
06-09-2011 04:48 PM
You're misunderstanding the meanings of a plot's existence, its color, and its visibility. In your code you are taking certain plots completely out of the picture by eliminating their existence via the Select Signals Express VI. That doesn't change the colors of the plots or their visibility. Thus, regardless of how many waveforms you feed the graph, the visibility and colors won't change. If, instead, you wire the array of waveforms to the graph, then you can control the visibility of a plot from your array of buttons by setting the "Visible" property of the active plot. This still won't change the color of the plot - it just makes it non-visible. However, you can use the Visible property to determine whether to spit out the actual plot color, or just the color black.
As for the actual implementation, you do not need to do this in a subVI, as it's more expedient to do this right in the loop. Also, Index Array can be resized.
See attached modification
06-09-2011 05:06 PM - edited 06-09-2011 05:06 PM
This is exactly what I need:)
Thanks a lot!
06-09-2011 05:52 PM
Uhm, wait...
It's not good enough for me:( I need signal selector and waves can't be just hidden cause it was only part of my project, after this part I've got some measurments (RMS, FFT) and I won't work correctly, and other graphs show all of signals:(
Maybe it will be easier to set color individually for each signal?
06-10-2011 08:58 AM
I don't understand your question.
06-10-2011 09:42 AM
I don't know how to explain it more clearly...
Look when I'm using hiding signals and math formulas... for example first signal * second signal
s1 * s2
and I have 3 signals: 1.sine, 2.square, 3.saw
When all of them are switched on its sine*square right?
but when sine is off it's still sine(hide)*square right?and the result will be the same
should be square*saw!