ps6000a Reference
Initializing ps6000a
import pypicosdk as psdk
scope = psdk.ps6000a()
scope.open_unit()
# Do something
scope.close_unit()
Reference
Bases: PicoScopeBase
PicoScope 6000 (A) API specific functions
Methods:
Name | Description |
---|---|
close_unit |
Closes the PicoScope device and releases the hardware handle. |
get_enumerated_units |
Returns count, serials and serial string length of a specific PicoScope unit. |
get_nearest_sampling_interval |
This function returns the nearest possible sample interval to the requested |
get_time_axis |
Return an array of time values based on the timebase and number |
get_timebase |
This function calculates the sampling rate and maximum number of |
get_unit_info |
Get specified information from unit. Use UNIT_INFO.XXXX or integer. |
get_unit_serial |
Get and return batch and serial of unit. |
get_values |
Retrieves a block of captured samples from the device once it's ready. |
is_over_range |
Logs and prints a warning if any channel has been over range. |
is_ready |
Blocks execution until the PicoScope device is ready. |
open_unit |
Open PicoScope unit. |
run_block_capture |
Runs a block capture using the specified timebase and number of samples. |
run_simple_block_capture |
Performs a complete single block capture using current channel and trigger configuration. |
set_channel |
Enable/disable a channel and specify certain variables i.e. range, coupling, offset, etc. |
set_data_buffer |
Tells the driver where to store the data that will be populated when get_values() is called. |
set_data_buffer_for_enabled_channels |
Sets data buffers for enabled channels set by picosdk.set_channel() |
set_siggen |
Configures and applies the signal generator settings. |
set_simple_trigger |
Sets up a simple trigger from a specified channel and threshold in mV |
stop |
This function stops the scope device from sampling data |
close_unit()
Closes the PicoScope device and releases the hardware handle.
This calls the PicoSDK CloseUnit
function to properly disconnect from the device.
Returns: |
|
---|
get_enumerated_units()
Returns count, serials and serial string length of a specific PicoScope unit.
Returns: |
|
---|
get_nearest_sampling_interval(interval_s)
This function returns the nearest possible sample interval to the requested sample interval. It does not change the configuration of the oscilloscope.
Channels need to be setup first before calculating as more channels may increase sample interval.
Parameters: |
|
---|
Returns: |
|
---|
get_time_axis(timebase, samples)
Return an array of time values based on the timebase and number of samples
Parameters: |
|
---|
Returns: |
|
---|
get_timebase(timebase, samples, segment=0)
This function calculates the sampling rate and maximum number of samples for a given timebase under the specified conditions.
Parameters: |
|
---|
Returns: |
|
---|
get_unit_info(unit_info)
Get specified information from unit. Use UNIT_INFO.XXXX or integer.
Parameters: |
|
---|
Returns: |
|
---|
get_unit_serial()
Get and return batch and serial of unit.
Returns: |
|
---|
get_values(samples, start_index=0, segment=0, ratio=0, ratio_mode=RATIO_MODE.RAW)
Retrieves a block of captured samples from the device once it's ready. If a channel goes over-range a warning will appear.
This function should be called after confirming the device is ready using is_ready()
.
It invokes the underlying PicoSDK GetValues
function to read the data into memory.
Parameters: |
|
---|
Returns: |
|
---|
is_over_range()
Logs and prints a warning if any channel has been over range.
Returns: |
|
---|
is_ready()
Blocks execution until the PicoScope device is ready.
Continuously calls the PicoSDK IsReady
function in a loop, checking if
the device is prepared to proceed with data acquisition.
Returns: |
|
---|
open_unit(serial_number=None, resolution=0)
Open PicoScope unit.
Parameters: |
|
---|
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: |
|
---|
Returns: |
|
---|
run_simple_block_capture(timebase, samples, segment=0, start_index=0, datatype=DATA_TYPE.INT16_T, ratio=0, ratio_mode=RATIO_MODE.RAW, pre_trig_percent=50)
Performs a complete single block capture using current channel and trigger configuration.
This function sets up data buffers for all enabled channels, starts a block capture, and retrieves the values once the device is ready. It is a simplified interface for common block capture use cases.
Parameters: |
|
---|
Returns: |
|
---|
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)
set_channel(channel, range, enabled=True, coupling=COUPLING.DC, offset=0.0, bandwidth=BANDWIDTH_CH.FULL)
Enable/disable a channel and specify certain variables i.e. range, coupling, offset, etc.
For the ps6000a drivers, this combines _set_channel_on/off to a single function. Set channel on/off by adding enabled=True/False
Parameters: |
|
---|
set_data_buffer(channel, samples, segment=0, datatype=DATA_TYPE.INT16_T, ratio_mode=RATIO_MODE.RAW, action=ACTION.CLEAR_ALL | ACTION.ADD)
Tells the driver where to store the data that will be populated when get_values() is called. This function works on a single buffer. For aggregation mode, call set_data_buffers instead.
Parameters: |
|
---|
Returns: |
|
---|
set_data_buffer_for_enabled_channels(samples, segment=0, datatype=DATA_TYPE.INT16_T, ratio_mode=RATIO_MODE.RAW)
Sets data buffers for enabled channels set by picosdk.set_channel()
Parameters: |
|
---|
Returns: |
|
---|
set_siggen(frequency, pk2pk, wave_type, offset=0.0, duty=50)
Configures and applies the signal generator settings.
Sets up the signal generator with the specified waveform type, frequency, amplitude (peak-to-peak), offset, and duty cycle.
Parameters: |
|
---|
Returns: |
|
---|
set_simple_trigger(channel, threshold_mv, enable=True, direction=TRIGGER_DIR.RISING, delay=0, auto_trigger_ms=5000)
Sets up a simple trigger from a specified channel and threshold in mV
Parameters: |
|
---|
stop()
This function stops the scope device from sampling data