## How to check data ready in stable average mode

timotili
Newbie
Posts: 0
Joined: Tue Jan 19, 2021 11:48 am

### How to check data ready in stable average mode

Hi,
The PicoScope (9301-15) can work well in multiple average mode (reading data with *RunControl:Single/*RunControl:Stop/Wfm?), but not in stable average mode. The PicoScope in stable average mode gives data-ready signal after the trigger of one-sample waveform, not after N-samples-average. How to solve this problem?
BR,
Timo

Tomash
Newbie
Posts: 0
Joined: Thu Jan 21, 2021 1:43 pm

### Re: How to check data ready in stable average mode

Thanks for your question. If you go into the description of the Stable Avg functions and look at the function formula, you will notice that it is executed iteratively each time making a new error correction. Each new collection affects the current averaging result and this process is not limited in the number of waveforms. The Average N value in this case determines the weight of the correction factor. The larger the value, the more accurate the error correction is.

Therefore, you have no way of knowing the end time of the averaging, because the process is unlimited. There are two ways to solve the problem:
• Exclusively use the Multiple Avg function;
• In Stable Avg mode, use the Run Until: Acquisitions function with which you can set the desired number of waveforms for the averaging. In this case, the algorithm looks like this:

Code: Select all

``````//Initialization
Acq:Ch1:Mode AvgStab
Acq:Ch1:NAvg 32       	// error correction factor of averaging
Acq:RunUntil NAcq
Acq:NAcq 32			// number of waveforms
*RunControl Stop

//Data Acquisition Cycle
*ClrDispl			// reset outdated values
*RunControl Run
While ( *RunControl? == Stop)  //wait until all 32 wavefroms are collected
wfm:Data?
``````

timotili
Newbie
Posts: 0
Joined: Tue Jan 19, 2021 11:48 am

### Re: How to check data ready in stable average mode

Thank you very much!