05-03-2016 09:56 AM - edited 05-03-2016 09:58 AM
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.
05-03-2016 10:30 AM
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.
05-03-2016 10:38 AM
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.
05-03-2016 11:51 AM
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.
05-03-2016 11:58 AM
@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.
05-03-2016 12:01 PM
Here I've modified your original BD and build the graph using re/im to complex and build array.
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.
05-03-2016 12:10 PM
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??
05-03-2016 12:12 PM - edited 05-03-2016 12:13 PM
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.
05-03-2016 12:24 PM
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.
05-03-2016 12:38 PM
Sir could you please attach the modified VI. I will try to understand by run it.