Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 CPU usage increase in RTScrollFrame

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
dmyancich Posted - 03 May 2007 : 09:27:14
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?

Thanks.
2   L A T E S T    R E P L I E S    (Newest First)
dmyancich Posted - 04 May 2007 : 17:24:58
Thank you for the answer. I will implement, and hopefully it will solve my problem.
quinncurtis Posted - 03 May 2007 : 14:11:14
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.

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07