LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot a XY graph in the case both X and Y are changing continuosly?

Hello all,

 

 I am using Labview 10. I need to plot a XY graph in the case both x and y values are changing. For example x=1, y= 2; x= 2, y=3; x=3, y=4;.......like that x and y values are changing continuosly. i tried to plot, but the XY graph screen shows the instantaneous values of x and y. But I need the plot of all the x and y values.

 

For your referecne I attached my VI.

 

 

Kindly help me in this regard,

 

Thanks in advance.

Download All
0 Kudos
Message 1 of 14
(4,794 Views)

An XY graph will update with the most recent data you send it. This means when you want to plot a set of data rather than just a point, you will have to send in a cluster of arrays. The Express VI hides it but you are basically just sending a single point right now.

0 Kudos
Message 2 of 14
(4,773 Views)

Here is an example using complex number data type (the real part is x and the imaginary part is y). The true case is what you want to do in order to maintain the previous points, the false case is what you are currently doing.

 

As an aside, if your x-values are equally spaced, you may want to use a chart, in which case you do feed a single value at a time and it will remember the history for you.

 

XY Graph keep.png

Message 3 of 14
(4,769 Views)

Thank you for your reply.

 

I tried using chart. I got stored Y values in the chart. But i have still not solved completely. when i run the program for second time, it continues from the previous values.

 

Could you please help me how to modify my VI using graph itself instead of chart. because i need to changeboth the x and y values. 

0 Kudos
Message 4 of 14
(4,751 Views)

@hariharan1992 wrote:

I tried using chart. I got stored Y values in the chart. But i have still not solved completely. when i run the program for second time, it continues from the previous values.


Use a property node of the chart.  There is a property called History.  Write an empty array to the History property and the previous run's data will be cleared.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 14
(4,741 Views)

Here I've modified your original BD and build the graph using re/im to complex and build array.

XY Graph 2.png

 

If you want to use a chart, you can clear the history of the chart at the beginning of your VI by wiring an emptry array to the "history" property node.

Message 6 of 14
(4,737 Views)

Sir, Thank you very much for your reponse.

 

In the case of graph, I can give x and y values. but in the case of chart, there is only one option for input (y). How can I give x values??

0 Kudos
Message 7 of 14
(4,730 Views)

For a chart you can go to the properties and set the scaling factors (on the scales tab). You can also do this using a property node. In either case, it assumes the data points are equally spaced.

Message 8 of 14
(4,726 Views)

You can take a look at this thread for more info on formatting the chart's x-axis. This particular example is to put time on the x-axis.

 

http://forums.ni.com/t5/LabVIEW/Multi-Plot-Chart-with-TIME-in-the-X-axis/m-p/3248022/highlight/true#...

Message 9 of 14
(4,716 Views)

Sir could you please attach the modified VI. I will try to understand by run it.

0 Kudos
Message 10 of 14
(4,709 Views)