Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 Real-Time Graphics Tools for .Net (VB and C#)
 CPU usage increase in RTScrollFrame
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  


7 Posts

Posted - 03 May 2007 :  09:27:14  Show Profile  Reply with Quote
I have implemented a time based RTScrollFrame with a single SimpleLinePlot under .NET/C#.
The graph displays 15 seconds of data, scrolling at realtime. (Data collection is 512 samples/sec)
The program needs to run continuously for a minimum of 24 hours.
The graph updates runs under a separate thread, where the updateDraw method is called in a delegate "callback" from a "TimerEventHandler".
Everything runs extremely well for about 1 hour, then things begin to slow down. (task manager show ~50% cpu at start for total system)
After approximately 3 hours CPU goes to ~80%, and by 4 hours the system is unresponsive.
If I run the application without updating the graph data (SetCurrentValue) the application runs with no system slowdown.

Is there something that I am doing/not doing with the RTScrollFrame that could cause this?



1563 Posts

Posted - 03 May 2007 :  14:11:14  Show Profile  Reply with Quote
The RTProcessVar datasets store all collected data by default. In your case that is 512 * 60 * 60 = 1.84 million data points per hour.

It doesn't sound like you need to keep all of those data points. In that case the datasets should be auto-truncated. Since you are displaying 15 seconds worth of data, you can truncate the data once you get more 30 seconds worth of data in the buffer. The data is truncated so there are still enough data points to fill the entire scroll frame. In the example below the dataset is auto-truncated when the number of data points reaches 15360. It is truncated to 10000 data points.

Use the RTProcessVar AutoTruncateDataset, AutoTruncateMinCount, and AutoTruncateMaxCount properties. When the scroll buffer reaches the AutoTruncateMaxCount value, it deletes the oldest data points until there are only AutoTruncateMinCount values in the buffer.

For example:

RTProcessVar EngineRPM1 = new RTProcessVar("RPM", defaultattrib);
EngineCylinders1.AutoTruncateDataset = true;
EngineCylinders1.AutoTruncateMinCount = 10000;
EngineCylinders1.AutoTruncateMaxCount = 15360;

Once you set these properties, you don't have to do anything else, the data will be truncated automatically.
Go to Top of Page


7 Posts

Posted - 04 May 2007 :  17:24:58  Show Profile  Reply with Quote
Thank you for the answer. I will implement, and hopefully it will solve my problem.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07