Installation guide

PicoScope 4000 Series (A API) Programmer's Guide 13
Copyright © 2008-2014 Pico Technology Ltd. All rights reserved. ps4000apg.en r1
3.6.2.3
Rapid block mode example 2: using downsampling
#define MAX_SAMPLES 1000
Set up the device up as usual.
Open the device
Channels
Trigger
Number of memory segments (this should be equal or more than the no of captures
required)
// set the number of waveforms to 100
ps4000aSetNoOfCaptures(handle, 100);
pParameter = false;
ps4000aRunBlock
(
handle,
0, // noOfPreTriggerSamples
1000000, // noOfPostTriggerSamples
1, // timebase to be used
&timeIndisposedMs,
1, // segmentIndex
lpReady,
&pParameter
);
Comments: the set-up for running the device is exactly the same whether or not
downsampling will be used when you retrieve the samples.
for (int c = PS4000A_CHANNEL_A; c <= PS4000_CHANNEL_H; c++)
{
ps4000aSetDataBuffers
(
handle,
c,
&bufferMax[c],
&bufferMin[c]
MAX_SAMPLES,
1,
downSampleRatioMode, // set to RATIO_MODE_AGGREGATE
);
}
Comments: since only one waveform will be retrieved at a time, you only need to set
up one pair of buffers; one for the maximum samples and one for the minimum
samples. Again, the buffer sizes are 1000 samples.
for (int segment = 10; segment < 20; segment++)
{
ps4000aGetValues
(
handle,
0,
&noOfSamples, // set to MAX_SAMPLES on entering
1000,
&downSampleRatioMode, //set to RATIO_MODE_AGGREGATE
index,