LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build XY Graph

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 16
(11,823 Views)
why not do what you said and use an XY instead of a waveform? Do you want to accumulate the data points at regular intervals even though your loop is not itterating at regular intervals?
Message Edited by for(imstuck) on 01-29-2009 03:57 PM
0 Kudos
Message 2 of 16
(11,801 Views)
Solution
Accepted by topic author zoran

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:

  • You also don't need the local variable, simply set the stop button th latch action.
  • Convert the time to DBL instead of EXT. EXT does not do anything useful in this case.

 

Message Edited by altenbach on 01-29-2009 01:59 PM
Message 3 of 16
(11,793 Views)

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.

0 Kudos
Message 4 of 16
(11,788 Views)
I guess I'll ask this here instead of starting a new thread. But is it possible to record data every 1 second even if your loop is set to itterate every 2000 ms? I feel like this may be difficult but I'm sure there's a way. Do you have to break the wait to add a point to your array?I'm not sure if/why you'd want to do this but I am just curious.
Message Edited by for(imstuck) on 01-29-2009 04:04 PM
0 Kudos
Message 5 of 16
(11,786 Views)

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).

0 Kudos
Message 6 of 16
(11,782 Views)

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

0 Kudos
Message 7 of 16
(11,740 Views)

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

0 Kudos
Message 8 of 16
(11,703 Views)

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!

Sincerely,

Chris G in AE
Message 9 of 16
(11,674 Views)

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)

0 Kudos
Message 10 of 16
(11,599 Views)