LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing color of plot during data collection

Hi all,

 

I am using the USB-6001 DAQ device to collect readings from a pressure sensor. The end goal is to run pressure sweeps, and I would like each pressure sweep to be a different color. I can't seem to figure out how to change the color of the graph mid-data collection. I intend to pressure sweep hundreds of times in one run, so using multiple plots will most likely slow down my program too much. I also need the color to change while the DAQ device is still collecting data. Does Labview have the functionality to change the color of specific sections of the same plot?

 

Thanks

0 Kudos
Message 1 of 9
(2,832 Views)

Right  click on the terminal and in the properties you can preset the colors for each plot.

 

C1Capture.PNGC2Capture.PNGC3Capture.PNG

 

Or you always can use a Property Node to set the color of the active trace

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 9
(2,818 Views)

You need to have multiple plots.  There is one color property for each plot.  If you need multiple colors, then you need to have multiple plots.  There really shouldn't be any slow down in your program whether  you were dealing with 1 long plot, more several shorter plots.

0 Kudos
Message 3 of 9
(2,814 Views)

Any advice on how to change what plot the data goes to during data collection? I need to write the measurements onto a new plot after every pressure sweep .

 

Thanks in advance

0 Kudos
Message 4 of 9
(2,786 Views)

Well I am guessing your measurements that you chart are going to be in an array, so write that array to a file and clear after each pressure sweep before start your next pressure sweep. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 9
(2,780 Views)

If I write the data to a file and then clear it, then I won't be able to see the side-by-side comparison of each sweep, no? The perfect result right now would be to run a pressure sweep, then have the next pressure sweep write to a different plot on the same graph in a different color. How would that be possible?

 

Thanks so much

0 Kudos
Message 6 of 9
(2,776 Views)

@studentguy12 wrote:

If I write the data to a file and then clear it, then I won't be able to see the side-by-side comparison of each sweep, no? The perfect result right now would be to run a pressure sweep, then have the next pressure sweep write to a different plot on the same graph in a different color. How would that be possible?

 

Thanks so much


I explained one way to do that above, and just save each pressure sweep to one column of a spreadsheet file not to a new file every time.

 

It's time to start coding, try a few things and show us where you are having trouble

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 9
(2,773 Views)

Right, I understand that, however I'm looking for a way to visually see the graph comparisons on the Labview front panel. The DAQ device I am using already records the data to a spreadsheet so I have the capability to view these trends out of Labview if I want to. I'm implementing this less as a necessity and more of a user-friendly feature, it would be nice to see the trends without always changing to a spreadsheet, on the LabVIEW front panel, preferably during data collection and not after.

 

I attached the part of my code that I'm looking to alter. The x and y values are continuously appended to arrays then put into the graph so I can see the data collection in real-time. I would like to be able to switch this data inflow to a new plot with each new pressure sweep. Let me know what you think, and thanks again.

0 Kudos
Message 8 of 9
(2,768 Views)

Okay here is a picture of what I do with a couple notes. Notice there is NOTHING in my code to change the color of the plot because I preset the plot colors as shown above.

 

mcCapture.PNG

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 9
(2,764 Views)