Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Too many points on the graph ?...

Hi,

I need to append a lot of data to my graph at a very high rate : I receive 2 points every ms.
Because I m kind with my graph, all the points are buffered and I only update the graph every 30 ms (following Bilal Durrani tips).

To improve the performances I call BeginUpdate then I plot all my buffered points and then I call EndUpdate.

It looks fine with a low history capacity, but I need to display like 10000 points at the same time.

And I have 2 matters :

1) when the plot hits his history capacity, the graph is jerked (I get used to it -_- I m gonna give my boss the NI charting demo and tell him there are 10000 points).
2) when the plot hits the end of my x axis ... it is the end of the world and Ctrl Alt Del is my friend.


It might be a code error from myself, but I feel that the WaveFormGraph cannot support that.

Any tips or ideas ?
0 Kudos
Message 1 of 5
(3,790 Views)
I made some impovement to my code and this is looking much better now. I m sorry about that !

The method
public void PlotYAppend ( double[] yData , System.Double increment )
is way faster than multiple calls of
public void PlotYAppend ( System.Double yData , System.Double increment )

(I thought I would have been the same with BeginUpdate/EndUpdate)

Now the points are not perfectly well placed but who cares when there are 10000+ points on the graph !

Thank you anyway for the very good forum ^^
0 Kudos
Message 2 of 5
(3,785 Views)
BeginUpdate/EndUpdate only affect updates on the screen. There is some logic that executes every time that data is plotted (i.e., axis scaling). This code runs regardless of BeginUpdate/EndUpdate. Therefore, as you observed, plotting more data at a time is faster.

"2) when the plot hits the end of my x axis ... it is the end of the world and Ctrl Alt Del is my friend."

What do you mean by this? What is happening and why do you have to use Ctrl+Alt+Del?

- Elton
0 Kudos
Message 3 of 5
(3,774 Views)
2) when the plot hits the end of my x axis ... it is the end of the world and Ctrl Alt Del is my friend

I mean it was so slow that my application was not responding. Fortunately it is faster now and the application doesnt crash anymore.

But I might have a last problem. To improve the speed I build a double[] each time I want to flush my buffered datas and so I call PlotYAppend only once. I wonder if there is a way not to build this array. I mean, it is slow to copy 100 items for each plot every time I update my graph (every 10 ms). I could use a double[] array to act as a buffer but the length would not fit.

The matter is I need to display 10 plots with 20000 points each (20000 is the number of points on the screen, so the history capacity is 20000 too, and I m charting 20 points every 10 ms). Is it possible with MS with more improvements of my code or I cannot do this ?


Pipo

PS: Btw we just received NI Dev suite 2005 woot 🙂 What's new ?
0 Kudos
Message 4 of 5
(3,773 Views)
What version of Measurement Studio are you using? 7.0? If you just received a new Dev Suite, it should have Measurement Studio 7.1. Even though it's a point release, it has a lot of new features. See "What's New in Measurement Studio 7.1" for more info. The online help also has a What's New topic that I think is more detailed than this.

Anyway, there were several graph performance enhancements added in 7.1, so if you're not using 7.1 yet, I encourage you to install it and try your application with the new version. I'm curious to hear if that made a difference in this application.

- Elton
Message 5 of 5
(3,761 Views)