User Manual

PicoScope 4000 Series Programmer's Guide 11
Copyright © 2008-2011 Pico Technology Ltd. All rights reserved. ps4000pg.en
4.6.2.2
Rapid block mode example 1: no 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,
10000, // noOfPostTriggerSamples,
1, // timebase to be used,
1, // oversample
&timeIndisposedMs,
1, // oversample
lpReady,
&pParameter
);
Comment: these variables have been set as an example and can be any valid value.
pParameter will be set true by your callback function lpReady.
while (!pParameter) Sleep (0);
for (int i = 0; i < 10; i++)
{
for (int c = PS4000_CHANNEL_A; c <= PS4000_CHANNEL_D; c++)
{
ps4000SetDataBufferBulk
(
handle,
c,
&buffer[c][i],
MAX_SAMPLES,
i
);
}
}
Comments: buffer has been created as a two-dimensional array of pointers to shorts,
which will contain 1000 samples as defined by MAX_SAMPLES. There are only 10
buffers set, but it is possible to set up to the number of captures you have requested.