Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

CWGraph increases CPU load as more data is added

When using multiple (in my case 😎 instances of the CWGraph control, the CPU load increases as more data is added. I am using the ChartY method and the chart is in 'Scope' mode, with a fixed chart history 50000 points. On a 400MHz PII, the CPU load starts at approx. 40%, and increases to > 80% after a few minutes. Since I am not using the 'stip-chart' scrolling mode,I can not understand why the CPU load should increase so much as time goes by.
Download All
0 Kudos
Message 1 of 5
(3,441 Views)
Here are a few things that you can do:


  • Set the GraphFrameStyle property to cwGraphFrameClassic.

  • Set the ImmediateUpdates property to False.

  • Set the Windowless property to True.



I tried these settings on all of the graphs in the project you posted and on my machine it cut the CPU usage in half. Please give this a shot and post how it worked out. Thanks.

- Elton
0 Kudos
Message 2 of 5
(3,441 Views)
Thank you for your suggestions, Elton.
The CPU load went down initially, but the suggestions did not affect the fact that the CPU load rises as time goes by while data is added to the chart. It does take a longer time before the CPU load "hits the roof", but it will eventually do so.

- Geir Inge -
0 Kudos
Message 3 of 5
(3,441 Views)
I think that the problem was in the Form_Load. Your project had:

Private Sub Form_Load()
Dim i As Integer
For i = 0 To 7
CWGraph1(i).ChartLength = 50000
Next i
End Sub

I changed it to:

Private Sub Form_Load()
Dim i As Integer
For i = 0 To 7
CWGraph1(i).ChartLength = 1000
Next i
End Sub

In my test, the application behaved the same, but the CPU usage did not gradually increase as it did before. Was there a reason that you needed the ChartLength to be 50000?

- Elton
0 Kudos
Message 4 of 5
(3,441 Views)
The large ChartLength was intentional. We need to be able to scroll back several minutes, and zoom-in/out with a large zoom-range.

- Geir Enge
0 Kudos
Message 5 of 5
(3,441 Views)