User Manual

PicoScope 4000 Series Programmer's Guide 15
Copyright © 2008-2011 Pico Technology Ltd. All rights reserved. ps4000pg.en
4.6.4
Streaming mode
Streaming mode can capture data without the gaps that occur between blocks when
using block mode. It can transfer data to the PC at speeds of up to 6.6 million
samples per second (150 nanoseconds per sample), depending on the computer's
performance. This makes it suitable for high-speed data acquisition, allowing you
to capture long data sets limited only by the computer's memory.
Aggregation. The driver returns aggregated readings while the device is
streaming. If aggregation is set to 1 then only one buffer is returned per channel.
When aggregation is set above 1 then two buffers (maximum and minimum) per
channel are returned.
Memory segmentation. The memory can be divided into segments to reduce the
latency of data transfers to the PC. However, this increases the risk of losing data
if the PC cannot keep up with the device's sampling rate.
See Using streaming mode for programming details.
4.6.4.1
Using streaming mode
This is the general procedure for reading and displaying data in streaming mode using
a single memory segment:
1. Open the oscilloscope using ps4000OpenUnit.
2. Select channels, ranges and AC/DC coupling using ps4000SetChannel.
3. Use the trigger setup functions
[1] [2] [3]
to set up the trigger if required.
4. Call ps4000SetDataBuffer to tell the driver where your data buffer is.
5. Set up aggregation and start the oscilloscope running using
ps4000RunStreaming.
6. Call ps4000GetStreamingLatestValues to get data.
7. Process data returned to your application's function. This example is using Auto
Stop, so after the driver has received all the data points requested by the
application, it stops the device streaming.
8. Call ps4000Stop, even if Auto Stop is enabled.
9. Request new views of stored data using different aggregation parameters: see
Retrieving stored data.