Average Function

Post your .Net discussions here
Stone_Mei
Newbie
Posts: 0
Joined: Fri Dec 22, 2017 6:28 am

Re: Average Function

Post by Stone_Mei »

Hi Martyn!

I will try.

Do you also have met the same question as I described?

Stone_Mei
Newbie
Posts: 0
Joined: Fri Dec 22, 2017 6:28 am

Re: Average Function

Post by Stone_Mei »

Hi Martyn!

I have tried,there is the same error.

Are you sure that Pico4824 support Downsampling Function?

I change the code based Demo in SDK,except for None,Average and Decimate and Aggregate all will indicate the same error.

If Pico4824 don‘t support Downsampling Function,please tell me,I will change my solution to avoid delay.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Average Function

Post by Martyn »

Using the ps4000a C# PS4000ABlockExample example from GitHub and just changing line 298

Code: Select all

                status = Imports.SetDataBuffers(handle, (Imports.Channel)i, maxBuffers, minBuffers, (int)sampleCount, 0, Imports.DownSamplingMode.None);
to
                status = Imports.SetDataBuffers(handle, (Imports.Channel)i, maxBuffers, minBuffers, (int)sampleCount, 0, Imports.DownSamplingMode.Average);// None);

and line 325

Code: Select all

                Imports.GetValues(handle, 0, ref sampleCount, 1, Imports.DownSamplingMode.None, 0, out overflow);
to
                Imports.GetValues(handle, 0, ref sampleCount, 100, Imports.DownSamplingMode.Average, 0, out overflow);
and the code runs without error for me.
Martyn
Technical Support Manager

Post Reply