User Manual
PicoScope 4000 Series Programmer's Guide 13
Copyright © 2008-2011 Pico Technology Ltd. All rights reserved. ps4000pg.en
4.6.2.3
Rapid block mode example 2: using aggregation
#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
ps4000SetNoOfCaptures (handle, 100);
pParameter = false;
ps4000RunBlock
(
handle,
0, //noOfPreTriggerSamples,
1000000, // noOfPostTriggerSamples,
1, // timebase to be used,
1, // oversample
&timeIndisposedMs,
1, // oversample
lpReady,
&pParameter
);
Comments: the set-up for running the device is exactly the same whether or not
aggregation will be used when you retrieve the samples.
for (int c = PS4000_CHANNEL_A; c <= PS4000_CHANNEL_D; c++)
{
ps4000SetDataBuffers
(
handle,
c,
&bufferMax[c],
&bufferMin[c]
MAX_SAMPLES,
);
}
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++)
{
ps4000GetValues
(
handle,
0,
&noOfSamples, // set to MAX_SAMPLES on entering
1000,
&downSampleRatioMode, //set to RATIO_MODE_AGGREGATE
index,
overflow