User manual

PicoScope 6000 Series Programmer's Guide 9
Copyright © 2009-2013 Pico Technology Ltd. All rights reserved. ps6000pg.en r9
3.5.1.1
Using block mode
This is the general procedure for reading and displaying data in block mode using a
single memory segment:
1. Open the oscilloscope using ps6000OpenUnit.
2. Select channel ranges and AC/DC coupling using ps6000SetChannel.
3. Using ps6000GetTimebase, select timebases until the required nanoseconds per
sample is located.
4. Use the trigger setup functions ps6000SetTriggerChannelConditions,
ps6000SetTriggerChannelDirections and ps6000SetTriggerChannelProperties to
set up the trigger if required.
5. Start the oscilloscope running using ps6000RunBlock.
6. Wait until the oscilloscope is ready using the ps6000BlockReady callback (or poll
using ps6000IsReady).
7. Use ps6000SetDataBuffer to tell the driver where your memory buffer is.
8. Transfer the block of data from the oscilloscope using ps6000GetValues.
9. Display the data.
10. Repeat steps 5 to 9.
11. Stop the oscilloscope using ps6000Stop.
12. Request new views of stored data using different downsampling parameters:
see Retrieving stored data.
3.5.1.2 Asynchronous calls in block mode
The ps6000GetValues function may take a long time to complete if a large amount of
data is being collected. For example, it can take 6 seconds to retrieve the full 1 billion
samples from a PicoScope 6403 or 6404B. To avoid hanging the calling thread, it is
possible to call ps6000GetValuesAsync instead. This immediately returns control to
the calling thread, which then has the option of waiting for the data or calling
ps6000Stop to abort the operation.