02-26-2012 10:37 PM
Hi,
I am taking a few measurements and want to display them all in one graph. Basically I want to use an xy-graph to display first only one curve (1st measurement) then two curves (1st+2nd) and so on. As I need to adjust some things for each measurement based on the previous one I cannot just display them altogether in the end.
Is there any way how to do this in labview?
Thanks in advance,
Florian
Solved! Go to Solution.
02-27-2012 01:02 AM
You can display multiple plots (curves) in a XY Graph. Note that, unlike LabVIEW charts, the LabVIEW Graphs will not hold the data in its own memory. So its the programmer duty to hold the data in temporary buffer.
The data type for multiple plot XY graph is - Array of cluster (cluster contains Array of X points & corresponding Y points).
Also you can add more scales to XY graph
02-27-2012 09:12 AM
Have you looked at the examples that ship with LabVIEW? There are examples on how to use charts and graphs which include how to display multiple plots. If you are dealing with an XY graph and you want it to work like a chart (i.e., data gets appended to it over time), then you can look at the "XY Chart" example, which uses a subVI as a buffer, as indicated in the previous post.
02-27-2012 07:42 PM
Thanks so far,
the problem for me is not to display multiple plots, it is more to add curves one after the other. I can't show a snipped of what I think but I'll try to explain in steps what I am trying to do:
1) I take the first measurement and display the data on a graph
2) I do some changes based on the first result
3) I take another measurement. Now I want to display 2 curves instead of one in the same graph as before
4) do some changes, another measurement
5) display all 3 curves in the graph
The problem is that if I create an array of the 3 curves it waits until the last measurement before the data is processed by the graph.
I use a flat sequence structure for the different steps and my solution so far is to add another graph after each step to display the curves (one curve in the first one, two in the second one and so on)
Is there any way how to do that?
Thanks a lot!
02-28-2012 07:10 AM
You can try with '.net' graph/chart. Which have a feature to control over plot by command.
https://decibel.ni.com/content/docs/DOC-9946
Regards,
Yogesh Redemptor
02-28-2012 07:37 AM
LV will not plot points that have the value "NaN" Not A Number. You can take advantage of that behaviour by using "NaN" values for the plots that you don't have data to fill in yet.
When you get to step 2 you use the real numbers insetead of NaN's. Lather, Rinse, Repeat.
Have fun,
Ben
03-06-2012 07:48 PM
Thanks for your help guys,
the trick I was missing was to create local variables of the graph each time I change something. Also I first created an array of how many curves I want in the end and fill them up with copies of the first measurement and replace them successively.
Works without a hitch now 🙂