Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting on more than one CWGraph components uses lots of cpu resource.

The cpu usage is over 95%. When we send some triangle waveform data over a DS socket, then receive the data from another appliction and try to plot the data on a CWGrahp component, the graph shows we loss some data points.points in the
0 Kudos
Message 1 of 5
(3,745 Views)
Hi,

The usage of the CPU will be directly related on how often you are updating the data in the DS connection. You can use the DS example that ships with MStudio to do some benchmarking on the behavior of the DS and graphs. About loosing the points, do you have some details on how are you establishing the communication?

Good luck with your application!

Juan Carlos
National Instruments
0 Kudos
Message 2 of 5
(3,745 Views)
Hi Juan:

We are trying to develop a data acquisition system. We need to pass 16 values every 8.33 ms by using DS Socket and display the 16 values in 16 CWGraph components.

I wrote two applications by modifying the DS Writer/Reader With Attributes examples.
To change the interval of the Sender, you have to change the interval of Timer1 in its properties in VB IDE.
To change the number of charts ploted on the CWGraph components, you have to comment or un-comment out the corresponding line in the Receiver VB code.

I run them on a Pentium 3, 600MHz, PC, the test result is:

1. The Receiver can not receive all the 16 values when the sender sends them in less than every 10 ms.
There are some packets lost during the transmission.

2. Whi
le the Receiver not plotting any chart, it can receive all the 16 values corrctly in all the packets when the Sender sends a packet in every 11 ms.

3. If the Receiver plots on one chart, it can receive all the 16 values corrctly in all the packets when the Sender sends a packet in every 12 ms.

4. If the Receiver plots on 16 charts and the Sender sends a packet in less than every 84 ms, the CPU usage will be 100% and the controls, such as lables, on the receiver GUI will not be updated corrctly.

5. If the Sender sends a packet in greater every 85 ms, the Receiver can receive the data and plots them on 16 charts corrctly.


The test results do not meet our requirement and my application is aimed to be used on some less powerful laptops. I hope it is not because the performance limit of the DS Socket and CWGraph.
I was wondering whether we can do something to increase the performance.

Pls find the attached source code files.


Thank you!
0 Kudos
Message 3 of 5
(3,745 Views)
There are a few things that you can do to speed up the performance of the graph:


  • Set the GraphFrameStyle property to cwGraphFrameClassic.

  • Set the ImmediateUpdates property to False.

  • Set the Windowless property to True.



Also, take a look at the ChartLength property and make sure that it's not any larger than you need it to be. Please give these suggestions a try and see if they help.

- Elton
0 Kudos
Message 4 of 5
(3,745 Views)
Thanks Elton.

It helps a little bit.
Right now, the Receiver can recive data correctly and plot on 16 charts when the Sender sends a packet in less than every 75 ms. However, this is far from our performance expectation, and the DS Socket still can not pass the 16 bytes data packet correctly within every 9 ms.

Maybe we already reach the performance boundary of the DS Socket and CWGraph? I hope not.
0 Kudos
Message 5 of 5
(3,745 Views)