User Manual

Programming with the PicoScope 4000 Series8
Copyright © 2008-2011 Pico Technology Ltd. All rights reserved.ps4000pg.en
4.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 aggregation 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 aggregation 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 6.6 MS/s (150 ns per sample). Aggregation 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.
4.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 ps4000MemorySegments).
Sampling rate. The PicoScope 4000 Series PC Oscilloscopes can sample at a
number of different rates according to their model, selected timebase and the
combination of channels that are enabled. The maximum sampling rate can be
achieved with a single channel enabled, or with these two-channel combinations:
AC, AD, BC and BD. All other combinations limit the maximum sampling rate of
scope, as specified in its Data Sheet.
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 ps4000RunBlock, ps4000Stop
and ps4000GetValues.