11-20-2009 03:30 PM
My goal is trying to display 4 different graphs on the the same XY graph when I run the VI 4 times. Right now, the new graph will overdrive the previous graph when I re-run the VI.
Please help!
Solved! Go to Solution.
11-20-2009 03:42 PM
Post your VI so we can see what you are doing now. Then we can provide instructions on what to change.
Put your code in a While or For Loop so that it runs 4 times. Store the previous results in a shift register. Then with the proper building of the array (depends on your data and its current layout), you can place new data in the shift register and add it to your graph. Look up in the Context Help and Example Finder for XY graph to see the different data formats you can use for building data into a graph.
11-20-2009 04:10 PM
This is my example.
I set total time is 10 with increment of 1. I run the VI, the VI will complete with the graph show 10 random numbers. If I re-run the VI, I would like to see the display of previous graph and the new graph.
11-20-2009 04:52 PM - edited 11-20-2009 04:53 PM
You need a mechanism for storing previous data; LabVIEW graphs do not have a history, they display sets of data. A shift register is an obvious answer, but it can get somewhat "tricky" when the Build XY Graph is used as it accepts a DDT and you cannot simply append a data set using array functions...
The solution?
Rather than make the changes for you, I've created a simple example for a regular graph to show you how to use an un-initialized shift register to store values from previous runs (the data will be lost when the VI is closed) as long as the VI is in memory.
I'll leave the DDT conversion from the 2D-array and XY graph implementation for you to figure out in case this is some form of a homework assignment.
Good luck!
-Bob
11-23-2009 12:33 PM
Hi Bob,
It took me awhile to firgure out the DDT conversion from the 2D-array and XY graph implementation. Finally, I got it.
Thanks for your help.