LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

to combine xy graphs

Hi, I dont have much experience in labview programming and I need some advice. 
 
Here's the scenario:  Inside a for loop, I have two 1-d array elements which are bundled up and linked to the xy graph function for plotting in real time.  The two 1d arrays are then linked to the write-to-spreadsheet function outside of the for loop and saved in an excel file.  In the write-to-spreadsheet function, the "append to file?" option is always true so that every time the for loop executes, the sets of data that are generated will be stored in the same excel file. 
 
But graphically on the front panel, the "xy graph" only graphs the data for each execution of the loop.  After each execution, the graph gets erased and new data is plotted.  My question is, is there any way I can put all the data (from all execution of for loop) on the same plot in real time? 
 
I am thinking about using the read-from-spreadsheet function at the same time to plot all the data that way.  But not sure if this is the smartest or easiest way to go about doing it.  Any advice on this would be much appreciated.  Thanks.
 
Jerry
0 Kudos
Message 1 of 7
(3,500 Views)
It seems you are autoindexing at the left loop boundary to form the array.
 
Use shift registers and "built array" inside the loop instead. Now you can bundle the growing x and y arrays for the x-y graph.
 
Still your description is not entirely clear. Could you attach a simple exmple?
0 Kudos
Message 2 of 7
(3,494 Views)
Hi,
 
I did use the build-array function and shift registers.  I have attached an example of the structure of the code.  For instance with total loop count equal to 5, in loop #0, data is plotted in xy graph with no problem.  Then to loop #1, the data from loop 0 gets erased, replaced with that from loop 1.... and so forth.  I want the data from loop 0 to 4 all appear on the same graph.  How should I go about doing it?  Any example provided would be much helpful.  Thanks. 
 
Jerry
 
 
The source of data that come out of the globals is 1d array of double. 

Message Edited by qiora on 09-08-2005 10:59 AM

0 Kudos
Message 3 of 7
(3,492 Views)
I don't see were your problem is. I have attached a small example, doing exactly what you have described. The result seems OK. Are you sure that your data generation is correct ?
Chilly Charly    (aka CC)
0 Kudos
Message 4 of 7
(3,480 Views)
I am sorry.  I made a mistake in making up that first example I provided.  Charly is right, that first example is correct.  I hope this new one would explain my problem. 
 
The loop where it takes in data and plots them in a graph is enclosed in a sequence loop, which is enclosed in a for loop.  So after the while loop condition is met, it exits the while and moved on to the next sequence.  Eventually all the sequences are executed and the for loop count would change.  I wanted the plots for each for loop execution to be accumulative in one xy-graph.
 
Sorry for the confusion.
0 Kudos
Message 5 of 7
(3,475 Views)
You have to use shift registers on the outside loop, and to concatenate the arrays coming out of the inner one.
 
Please do not use bitmaps. Prefer jpeg, gif or png images. They save memory space and bandwith. Or even better, attach your vi. That way, we could modify it and return you a corrected version.
Chilly Charly    (aka CC)
0 Kudos
Message 6 of 7
(3,469 Views)

I can not open version 7.1 files so I dont know if my example is the same as the one chilly charlie provided.

Here is my example with arrays that hve data as default values.

Mario

 

0 Kudos
Message 7 of 7
(3,455 Views)