Installation guide

Programming with the PicoScope 4000 Series (A API)8
Copyright © 2008-2014 Pico Technology Ltd. All rights reserved.ps4000apg.en r1
3.6
Sampling modes
PicoScope 4000 Series PC Oscilloscopes can run in various sampling modes.
Block mode. In this mode, the scope stores data in internal RAM and then
transfers it to the PC. When the data has been collected it is possible to examine
the data, with an optional downsampling factor. The data is lost when a new run is
started in the same segment, the settings are changed, or the scope is powered
down.
Rapid block mode. This is a variant of block mode that allows you to capture more
than one waveform at a time with a minimum of delay between captures. You can
use downsampling in this mode if you wish.
Streaming mode. In this mode, data is passed directly to the PC without being
stored in the scope's internal RAM. This enables long periods of slow data collection
for chart recorder and data-logging applications. Streaming mode provides fast
streaming at up to 160 MS/s with a USB 3.0 connection. Downsampling and
triggering are supported in this mode.
In all sampling modes, the driver returns data asynchronously using a callback. This is
a call to one of the functions in your own application. When you request data from the
scope, you pass to the driver a pointer to your callback function. When the driver has
written the data to your buffer, it makes a callback (calls your function) to signal that
the data is ready. The callback function then signals to the application that the data is
available.
Because the callback is called asynchronously from the rest of your application, in a
separate thread, you must ensure that it does not corrupt any global variables while it
runs.
In block mode, you can also poll the driver instead of using a callback.
3.6.1
Block mode
In block mode, the computer prompts a PicoScope 4000 Series PC Oscilloscope to
collect a block of data into its internal memory. When the oscilloscope has collected
the whole block, it signals that it is ready and then transfers the whole block to the
computer's memory through the USB port.
Block size. The maximum number of values depends upon the size of the
oscilloscope's memory. The memory buffer is shared between the enabled channels,
so if two channels are enabled, each receives half the memory. These features are
handled transparently by the driver. The block size also depends on the number of
memory segments in use (see ps4000aMemorySegments).
Sampling rate. The maximum sampling rate of 80 MS/s can be achieved with up
to four channels enabled. With five or more channels enabled, the sampling rate is
reduced to 40 MS/s.
Setup time. The driver normally performs a number of setup operations, which can
take up to 50milliseconds, before collecting each block of data. If you need to
collect data with the minimum time interval between blocks, use rapid block mode
and avoid calling setup functions between calls to ps4000aRunBlock,
ps4000aStop and ps4000aGetValues.