LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buiiding a Scrolling Graph

I am trying to build a VI that will have a scrolling waveform graph that shows only the most recent two minutes of data.  To accomplish this, I am using property nodes with the x-scale min and max calculated.  However, when I run this VI, there is a "shadow" effect on the plot.  It appears as if the VI is trying to change to a default x-axis scale in between when my code forces it to the scale max and min I am trying to specify.  I've attached the VI file so you can see what I'm experiencing.  Any hints or help would be greatly appreciated!  Thanks!
 
Andrew
0 Kudos
Message 1 of 8
(3,534 Views)

Hello Andrew,

Not too sure about your code, but is there any reason that you are trying to use a graph and not a chart?  A chart is specifically designed to be scrolling, and update with the last X points of data.  If you wish to use a graph to display the data, I think the best way to proceed would be to use an array of only the last 2 minutes of data and just plot that array shifting in elements as they become available.  I don't think you would need to use any of the graph property nodes for that. 

Please let me know if you have any questions on any of this-

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 8
(3,521 Views)
Travis,
 
Yes, we are interesting in using graphs specifically because we want to include the annotation ability of graphs which is currently unavailable in charts.  Not sure why they haven't  inlcuded that for charts, but there you go.  To be honest, our VI is currently set up using charts, but we want to see if we can adapt graphs to our purposes.  Hence, the sample VI I included in my original post.
 
I'll give your method with using only a two minute array of data to plot and let you know (on here anyway) how it goes.  Thanks for the insight.
 
Drew
0 Kudos
Message 3 of 8
(3,516 Views)

You might find the attached VI useful.  The top example implements a buffer with an array and just plots that array to the graph each iteration of the loop.  The bottom example uses the "rotate array" function to shift in new values to the front of your array of data points.  The first thing the VI does is set up the size of the array dependant on the time between loop iterations.  The top example is for sure efficient since no new array is ever needed, but the bottom one seems intuitively slow since you are shifting elements in and out of an array by moving all the other elements.  The memory profiler does NOT show any need for buffer allocations on that "rotate array" VI.  Rest assured though, each element is copied to the previous space so its pretty close in speed to allocating new arrays each time (O(n) operation).

Hopefully this helps too-

Message Edited by Travis M. on 03-22-2006 02:41 PM

Travis M
LabVIEW R&D
National Instruments
Message 4 of 8
(3,504 Views)

Travis,

Hi, I really like your example using scrolling bars and now I would like to read and display a spreadsheet. My file will only have a single column. I'm having a little difficulty getting it to work. Could I trouble you by giving me some pointers or by modifying the example? I would really appreciate it.

thanks,

joe

0 Kudos
Message 5 of 8
(3,477 Views)

Hey Travis,

Thanks for the insight.  I did end up getting what I wanted.  I attached the example VI I will be using:

Cheers!

Andrew

 

0 Kudos
Message 6 of 8
(3,475 Views)

Andrew,

Hi, how much trouble would it be to do scrolling in ver 7.1?

thanks,

joe

0 Kudos
Message 7 of 8
(3,471 Views)

Joe,

Unfortunately, I only have LabVIEW 8.0, but it should still be doable in 7.1.  I've attached a few screen shots of the block diagram I used so you can replicate it in 7.1.  The only difference between the two is that the each shows the a different frame of the stacked sequence structure.  Hope this helps.

Andrew

0 Kudos
Message 8 of 8
(3,461 Views)