03-16-2016 08:28 AM
I have an experiment that runs for days. I generate several X-Y scatter plots that update periodically as new data is taken. The problem is after I run at (environmental condition 1) I generate a plot say (Power VS Current at Environmental condition 1). Then I want to overlay (Power VS Current at Environmental Condition 2) , Environmental Condition 3 etc....
So the X-Y graph updates periodically, then the experiment restarts at a different envirnmental condition, and I want to overlay that on the existing X-Y scatter plot.
How do I do this, there has to be a way?
03-16-2016 09:26 AM - edited 03-16-2016 09:27 AM
I do this all the time in Excel and the general idea is you need to use elapsed time instead of absolute time (time stamp) as the X axis.
03-16-2016 09:42 AM
That was absolutely no help whatsoever.
1) I am programming a live experiment in labview.
2) The X Axis has to be Laser Current, TEC Current, Case Temp etc.... The Y values are things like Power, Mean Wavelength, FWHM etc....
3) As the experiment runs the graph is populated 1 point at a time, live, while its running, [1) Increment Current, 2) Take Data 3) Graph, 4) Repeat until finished] , Increment environmental condition [1) Increment Current, 2) Take Data 3) Overlay on prior graph, 4) Repeat until finished] , Increment environmental condition
When you are done you have 3 different X-Y scatter plots, generated 1 point at a time, overlayed.
If I want snazzy graphs after the fact for reports I use MATLAB.
03-16-2016 09:45 AM
Can I "Un-Kudo" this?
03-16-2016 09:46 AM
Basically, each new plot will be a new plot on the same x-y graph. The general process will be a loop that selects the plot to write to, then writes the data to that plot.
03-16-2016 09:49 AM
I guess I missunderstood you
Then all you need to do is plot one then change the plot color and plot another one over the top of it.
03-16-2016 09:52 AM
The advantage of the way I suggested is that you end up with distinct plots.
The advantage of RTSLVU's way is that it's a lot easier!
03-16-2016 09:56 AM
Ok, BUt how do I keep from overwriting the initial plotted information. Are you saying I should set up the graph at the start with (for instance) 3 unpopulated x-y arrays, then slowly poplate them. I don't really know how many points are to be plotted. Some of it is time based so I have been growing the array at each data point.
03-16-2016 10:41 AM - edited 03-16-2016 10:44 AM
There are different things you should consider, but the main point is to take some more tutorials to deepen your knowledge in LabVIEW. Do you clearly understand how shift registers work for example? If the answer is no, I strongly advice you to look at the LV learning options/resources.
An XY Graph is an object in LV which will plot what you "throw" at it. Nothing more and nothing less. You can plot multiple curves too.
The other part of the story how you store the data in RAM of your long term ongoing measurement? If your code contains building data arrays in an unlimited way, it is called a memory leak. You need to limit the sizes of your arrays, and also decide what kind of logging/presenting technique you wanna use.
I can give you an example how I do it in one of my projects where I have experiments running for days:
EDIT1: It can be also that you are confusing the Charts and XY Plots in LV: Charts have built-in memory (by default 1024 points per plot), XY Graphs do not have, they just plot what is connected to them.
03-16-2016 10:44 AM - edited 03-16-2016 10:47 AM
I think that the x-y graph won't remember previous plots - as you've found out - so you have to remember each plot as an element of an array in a shift register. I suppose you could us an Action Engine to accomplish this.
Edit:
I see Blokk has suggested something very similar, and expanded, too.