05-15-2018 04:22 AM
Hello dear community of Labview ,
I am a newbie in LabVIEW and am face to a problem. I request your helps please .
I have created a state machine and in the sinus state, I want to change the colour of my curve for each relaunch of the sinus state. Do you know how to do that? I am thinkink about 2-3 weeks ago with any solutions
Thank you in advance for your answers!
Ngoc-Vinh Truong
05-15-2018 04:36 AM
Hi Ngoc-Vinh,
I want to change the colour of my curve for each relaunch of the sinus state.
Do you want to change the color of the full plot (1) or do you want to see several sine waves in different colors (2)?
1: set the color of the plot using a property node of the XY graph
2: create an array of plots and assign a different color to each plot
Item 2 becomes easy once you get rid of the BuildXYGraph-ExpressVI…
05-15-2018 04:37 AM
The plot color is a property of the graph. Right-click on the XY-Graph terminal, click on Create -> Property, then navigate downward in the properties list until you find Plot -> Plot Color. Right click on the property node and select Change to Write.
Now you can connect a constant to the property node and see what happens. As you want to change the colour every time, you need to select or generate it automatically. In the Graphics&Sound -> Picture Functions palette, you can find useful functions.
05-15-2018 05:02 AM
I want to see several curves in differents colors (2). I have already worked on it (see attachement) but I have a bug on my main program so I prefer to downgrade my program to the easy way ( build XY)
Do you have an idea to change the color with the function "build XY" ?
05-15-2018 05:10 AM
Pincpanter,
I have already think about this solution but I do not know how it works. I try to connect the property node to a constant but the curve does not change color
05-15-2018 05:40 AM
Hi vinh,
I try to connect the property node to a constant but the curve does not change color
It will not change the color when you wire a constant…
In your case the problem are the plot properties you have set for the plot: make the plot legend visible and change the plot properties to show a line between the point. The line will use the color of your color constant!
On the other VI: you reall yshould not use ExpressVI functions (like JoinSignal) and DDT wires in such a VI…
05-15-2018 10:05 AM
So what do you advice me to do ?
Because I do not understand what do you mean by :
"create an array of plots and assign a different color to each plot"
Do you mean by creating a shift register and creating a array?
After that step, I do not follow you by assigning a different color to each plot ( How do you wire that ?)
Sorry, I am lost ...
Sincerely,
Ngoc-Vinh Truong
05-15-2018 11:05 AM
This is how you do it.
05-16-2018 04:41 AM
Thank you for your answer but I do not think you , it will help me.
I write that I am in the sinus state but in this state, I do not use sine wave, I have used function random number 0 to 1 and the index ( refer to my Vi)
Do you have another answer to give me please ?
Thank you
05-16-2018 07:14 AM
My example showed you how to do what you need to do. You need to replace the sine wave generator and add what you need to do. I was not trying to solve your problem that is your homework. I simply showed you how to achieve your goal. You still need to figure out a few things on your own.