01-29-2009 03:23 PM
I have problem with making XY Graph user friendly. In my case loop execution time will be variable, so I cannot use waveform chart because timing gets off - look at the picture of vi.
How I can make XY Graph to start from the leftmost position, not use autoscale and use x axis scrollbar?
Thanks,
Zoran
Solved! Go to Solution.
01-29-2009 03:55 PM - edited 01-29-2009 03:57 PM
01-29-2009 03:58 PM - edited 01-29-2009 03:59 PM
All you axes are set to autoscale, so you shoud turn that off.
It is probably a bad idea to grow infinite datasets inside the "built xy graph express VI", so a more manageable solution would be to do your own fixed size history buffer. Use an action engine, for example.
Anyway, in order for the x scrollbar to be visible, the data x-range needs to be wider than the axis x-range. You could just update the max and min according to the current time, e.g. as follows. All this needs more work, for example you don't want to update the range settings while the user is scrolling.
Also:
01-29-2009 04:01 PM
I did use XY, waveform gets wrong time, but I cannot find out how to make it to look like waveform. I want to control Y-axis limits, use X-axis scroll bar, not to start from the middle of graph.
01-29-2009 04:03 PM - edited 01-29-2009 04:04 PM
01-29-2009 04:08 PM
for(imstuck) wrote:
But is it possible to record data every 1 second even if your loop is set to itterate every 2000 ms?
If the loop is only iterating every 2000ms , it makes no sense to update the chart at twice the rate.
If you switch your numbers around, you could use a case structure and switch cases depending if [i] is odd or even. (Easiest: Do a bitwise AND of [i] with an I32 "1" diagram constant and make one case 1(odd) and the other 0,default (even).
01-30-2009 09:08 AM
Thank you, this works.
Graph still flickers when is running, like there are two traces on it. It's not big deal I will try to fix it later.
Zoran
02-02-2009 12:19 PM
This works nice, but now I have to plot more then one trace. I used waveform chart before, any idea how to put more traces on X-Y Graph?
Thanks
02-03-2009 11:54 AM
zoran,
Check out the XY Graph.vi example from the NI Example Finder (Help » Find Examples » search for "xy" without quotes). This example demonstrates how to write multiple plots to an XY Graph. Post back if this doesn't answer your question. Have a great day!
02-09-2009 06:46 PM
Is that possible to plot a XY graph in "Lines on 2 Axes" as in excel. I attached a picture for your review.
(Is means two Y-axis in left and right and with one X-Axis)