Data Acquisition: Block & Streaming

Bases: PicoScopeBase, shared_ps6000a_psospa, shared_4000a_6000a

PicoScope 6000 (A) API specific functions

Methods:

Name Description
run_block_capture

Runs a block capture using the specified timebase and number of samples.

run_simple_block_capture

Perform a complete single block capture.

run_simple_rapid_block_capture

Run a rapid block capture with X amount of captures/frames/waveforms

run_streaming

Begin a streaming capture.

stop

Stop data acquisition on the device.

run_block_capture(timebase, samples, pre_trig_percent=50, segment=0)

Runs a block capture using the specified timebase and number of samples.

This sets up the PicoScope to begin collecting a block of data, divided into pre-trigger and post-trigger samples. It uses the PicoSDK RunBlock function.

Parameters:
  • timebase (int) –

    Timebase value determining sample interval (refer to PicoSDK guide).

  • samples (int) –

    Total number of samples to capture.

  • pre_trig_percent (int, default: 50 ) –

    Percentage of samples to capture before the trigger.

  • segment (int, default: 0 ) –

    Memory segment index to use.

Returns:
  • int( int ) –

    Estimated time (in milliseconds) the device will be busy capturing data.

run_simple_block_capture(timebase, samples, segment=0, start_index=0, datatype=DATA_TYPE.INT16_T, conv_to_mv=True, ratio=0, ratio_mode=RATIO_MODE.RAW, pre_trig_percent=50)

Perform a complete single block capture.

Parameters:
  • timebase (int) –

    PicoScope timebase value.

  • samples (int) –

    Number of samples to capture.

  • segment (int, default: 0 ) –

    Memory segment index to use.

  • start_index (int, default: 0 ) –

    Starting index in the buffer.

  • datatype (DATA_TYPE, default: INT16_T ) –

    Data type to use for the capture buffer.

  • conv_to_mv (bool, default: True ) –

    If True, function will return a float mV array. If False, function will return a ADC array specified by datatype arg.

  • ratio (int, default: 0 ) –

    Downsampling ratio.

  • ratio_mode (RATIO_MODE, default: RAW ) –

    Downsampling mode.

  • pre_trig_percent (int, default: 50 ) –

    Percentage of samples to capture before the trigger.

Returns:
  • dict

    tuple[dict, list]: Dictionary of channel buffers (in mV) and the time

  • ndarray

    axis in nano-seconds (numpy array).

Examples:

>>> scope.set_channel(CHANNEL.A, RANGE.V1)
>>> scope.set_simple_trigger(CHANNEL.A, threshold_mv=500)
>>> buffers = scope.run_simple_block_capture(timebase=3, samples=1000)

run_simple_rapid_block_capture(timebase, samples, captures, start_index=0, datatype=DATA_TYPE.INT16_T, conv_to_mv=True, ratio=0, ratio_mode=RATIO_MODE.RAW, pre_trig_percent=50)

Run a rapid block capture with X amount of captures/frames/waveforms

Parameters:
  • timebase (int) –

    PicoScope timebase value.

  • samples (int) –

    Number of samples to capture.

  • captures (int) –

    Number of waveforms to capture.

  • start_index (int, default: 0 ) –

    Starting index in buffer.

  • datatype (DATA_TYPE, default: INT16_T ) –

    Data type to use for the capture buffer.

  • conv_to_mv (bool, default: True ) –

    If True, function will return a float mV array. If False, function will return a ADC array specified by datatype arg.

  • ratio (int, default: 0 ) –

    Downsampling ratio.

  • ratio_mode (RATIO_MODE, default: RAW ) –

    Downsampling mode.

  • pre_trig_percent (int, default: 50 ) –

    Percentage of samples to capture before the trigger.

Returns:
  • dict

    tuple[dict, np.ndarray]: Dictionary of channel buffers (in mV) and the time

  • ndarray

    axis in nano-seconds (numpy array).

run_streaming(sample_interval, time_units, max_pre_trigger_samples, max_post_trigger_samples, auto_stop, ratio, ratio_mode)

Begin a streaming capture. This wraps the RunStreaming driver call and configures the acquisition according to the provided arguments. Args: sample_interval: Requested interval between samples. time_units: Unit for sample_interval. max_pre_trigger_samples: Number of pre-trigger samples to collect. max_post_trigger_samples: Number of post-trigger samples to collect. auto_stop: Whether the driver should stop when the buffer is full. ratio: Down sampling ratio. ratio_mode: Down sampling mode. Returns: float: The actual sample interval configured by the driver.

stop()

Stop data acquisition on the device.

Returns:
  • None

    None