PDA

View Full Version : Real time plot with high sample/refresh rate.



astodolski
23rd April 2013, 15:49
Using the oscilloscope example as a basis for plotting data in real-time using the QwtSamplingThread, I can't seem to get a trace to display fast enough with high refresh rates. I want to read an ADC to gather 1000 samples every 15 mS. The examples included in the Qwt build all relate to slow plots/refresh rates.

Uwe
23rd April 2013, 16:10
The refresh rate of the plot in the oscilloscope example depends on a timer with an interval of 10ms ( of course it is not really 10ms as QTimer is not an accurate system timer ). The timer interval checks if the curve has changed and draws new samples only. The sample rate and how to gather samples is completely unrelated to this.

For 1000 samples every 15ms I would expect a refresh rate of 10ms as being too short - depends on your system. The fastest Qt environment for this type of application should be Qt 4.8 with the X11 graphicssystem ( = native ). With Qt 5 or Qt 4 on Windows ( or Qt 4.8 on X11 not using the native graphicssystem ) you will end up with a pure software renderer.

Uwe

astodolski
23rd April 2013, 18:34
The refresh rate of the plot in the oscilloscope example depends on a timer with an interval of 10ms ( of course it is not really 10ms as QTimer is not an accurate system timer ). The timer interval checks if the curve has changed and draws new samples only. The sample rate and how to gather samples is completely unrelated to this.

For 1000 samples every 15ms I would expect a refresh rate of 10ms as being too short - depends on your system. The fastest Qt environment for this type of application should be Qt 4.8 with the X11 graphicssystem ( = native ). With Qt 5 or Qt 4 on Windows ( or Qt 4.8 on X11 not using the native graphicssystem ) you will end up with a pure software renderer.

Uwe

With that limitation, it seems that the approach to data acquisition should be to gather a buffer's worth of data (100 points) every tick and then plot every fourth sample - if that makes sense. It looks like the o'scope sample plots every point.