LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save data on a graph and then add new data to it

i am currently plotting data on a graph from a physical system. However when i want to add new data to the plot, the old one is replaced. I am trying to do more than one plot on the same graph, where the incoming data is at different times. I want something like Excel where i can just add a new plot to the graph.Can i save the data or freeze it onto the graph or something so that i can add a new plot and see the two at the same time?
0 Kudos
Message 1 of 4
(3,293 Views)
Graphs do not have a buffer to keep previous data so even if you just have one plot and you want to add a single point to that plot you will need to feed the graph with all the data it is to show, not just the additional. In other words; you'll need to create a buffer to hold all the data that you want to show on the graph. A circular buffer is a good option e.g.

If you have multiple plots you'll need to build a 2D array of them and write that 2D array to the graph. If you need to use an XY graph bundle the X and Y array, and build an array of such clusters and feed that array to the XY graph.

Charts on the other hand do have an in-built buffer and can often be the simplest way to solve this.

Check out all the graph/chart/multiplot examples shipping w
ith LV by using the example finder from the help menu of LV and you'll find lot's of good stuff.
Message 2 of 4
(3,293 Views)
> i am currently plotting data on a graph from a physical system.
> However when i want to add new data to the plot, the old one is
> replaced. I am trying to do more than one plot on the same graph,
> where the incoming data is at different times. I want something like
> Excel where i can just add a new plot to the graph.Can i save the data
> or freeze it onto the graph or something so that i can add a new plot
> and see the two at the same time?

As the other post pointed out, there are two objects in LV for plotting,
graphs and charts. If you wish to have a chart recorder that
accumulates data into one or more plot with time, you probably want a chart.

If you push a button and acquire a trace and want to add that to your
graph, you just need to
combine it with the data you plotted before and
update the graph. It isn't the most efficient, but you can easily read
the value of the graph using a local, add another row or column or
element to your data and send it to the graph.

To directly answer your other question, no, the grah doesn't have a
functional interface for clearing, adding, or deleting plots. Instead,
you do that with the diagram nodes and give the graph the results.

Greg McKaskle
Message 3 of 4
(3,293 Views)
hey thank alot man, im gonna try to do it with the charts instead.it doesnt matter if its graphs or charts i just want to be able to save the data and add a new plot to it
0 Kudos
Message 4 of 4
(3,293 Views)