LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

X-Y valeus graph

Solved!
Go to solution

Is there anyway to plot a x-y graph that keep its historic data in the loop?

 

I have tried using shift register, but DBL, not C1,C2, is showed inside the bundle.

 

 

0 Kudos
Message 1 of 5
(2,046 Views)

You need to put some type of while loop around the process and use a shift register with a 2D array of data, or two shift registers each with a 1D array to build up your data array.  Then you index the array to get the X and Y sub arrays.  One could also put the 2D array in a feedback node within the program.  What ever you do you need to build up the array each time that you iterate the loop.

 

Watch out that you do not allow it to get to big.  A few thousand points and it will take 100 ms to update the screen 100,000 points will take a few seconds. 

 

At some point the program will crash because of memory overload.  Before that happens you should do something like delete the oldest row and add a new row each time through the loop.

 

Don't forget to init the shift register either by wiring it to a blank 2D array or internally the first time through the loop. 

 

From a memory allocation standpoint using build array inside of the loop is not really efficient but it will work.

 

 

0 Kudos
Message 2 of 5
(2,007 Views)
Solution
Accepted by topic author hohi7745

You used regular Bundle.  So it just shows the datatype coming in.  Try using Bundle by Name and wire a typedef constant into the top with the names of the elements as C1 and C2 if that is what you want to see.

 

There is a Build XY Graph Express VI on the palettes.  It drops an XY Graph and an Express VI that will keep a history for you.

0 Kudos
Message 3 of 5
(2,006 Views)
Solution
Accepted by topic author hohi7745

I usually make my X/Y graphs a sub-vi that is basically an "action engine" that way it holds it's own history, has an Initialize function, and makes a neater block diagram.

 

Here's the graphing state, you can see the shift registers that keep the chart history

G1Capture.PNG

 

Here's the Initialize state, where I clear the graph and set the X-Axis 

G2Capture.PNG

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(1,996 Views)

For simplicity, I recommend keeping a complex 1D array in a shift register. No need to bundle.

(XY graphs understand complex arrays and will graph IM vs. RE)

 

altenbach_0-1634331667441.png

 

0 Kudos
Message 5 of 5
(1,977 Views)