LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change the color of part of a waveform plot based on button

Solved!
Go to solution

Hello,

I'm plotting temperature sensor DAQ measurements, and I want to change the color (red, blue, yellow) of part of the plot based on button selections (heating, cooling, pumping). I wrote a program, but the problem is that it changes the color of the entire plot.

Is there a solution for this?

Thanks.

 

0 Kudos
Message 1 of 25
(631 Views)

Hello,

unfortunately LabVIEW graphs don't support multicolored plots (I think due to performance reasons).

You can use three plots with different colors, putting your valid data point into the according plot. The other plots are to be set with NaN, this makes them invisible.

See the attached VI.

 

Heating-Cooling-Pumping.png

 

 

Greets, Dave
Message 2 of 25
(607 Views)

A technique I have seen is to have a plot per coloring to disable the use of the value NaN.

 

 

For example, if you need to have a plot where 0-10s is heating, then 10-12s is pumping and 12-14s is cooling, populate the waveform with valid values only for the segment it needs to be displayed and the rest be NaN.

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 3 of 25
(606 Views)

Thank you for the response, but I cannot open the file. Error: The file version is later than the current LabVIEW version.

0 Kudos
Message 4 of 25
(571 Views)

Here is daveTW's VI attached in LV 2015

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 25
(566 Views)

Thank you for the response, I understood the technique, but I had some issues with the condition of the buttons and manipulating the DAQ Assistant signal.

0 Kudos
Message 6 of 25
(565 Views)

Thank you for the response, I understood the technique, but I had some issues, i dont know how to link buttons state with changing color conditions. 

0 Kudos
Message 7 of 25
(508 Views)

Please explain in detail what you want to achieve with the buttons. This keeps us from guessing around.

Draw an image!

Greets, Dave
0 Kudos
Message 8 of 25
(500 Views)

I'm going to control a pump, a heater, and a cooler using three buttons in the user interface. I also have a temperature sensor, and I want to show the three phases in a graph by coloring the curve. If the pump is activated, the curve should be colored yellow; if the heater is activated, the color should be red; and if the cooler is activated, the curve should be blue. I have attached the VI below.

MEHDI_LIS_0-1719303876535.png

 

0 Kudos
Message 9 of 25
(490 Views)

Hi Mehdi,

 


@MEHDI_LIS wrote:

 I want to show the three phases in a graph by coloring the curve. If the pump is activated, the curve should be colored yellow; if the heater is activated, the color should be red; and if the cooler is activated, the curve should be blue.


So instead of using InRangeAndCoerce to decide which plot to use you will use those 3 buttons to decide which plot will show the current sample: you just need to change that decision making in your VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 25
(486 Views)