LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display 4 graphs on the same graphs display when running the VI 4 times ?

Solved!
Go to solution

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!

0 Kudos
Message 1 of 5
(3,100 Views)

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.

Message 2 of 5
(3,094 Views)

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.

0 Kudos
Message 3 of 5
(3,079 Views)
Solution
Accepted by topic author CP_AT

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

 

Message Edited by B O B on 11-20-2009 04:53 PM
0 Kudos
Message 4 of 5
(3,069 Views)

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.

 

0 Kudos
Message 5 of 5
(3,022 Views)