dso_meas module

Perform automated measurements on the DSO.

Basic signal parameters in both vertical and horizontal dimensions are calculated using the atuomated measurement functions.

Typical usage example:

from dso_const import *
import dso2ke as gds

# Create a Dso instance, myDso, and get connected to it.
myDso = gds.Dso()
ret = myDso.connect(host='localhost', port=3000)
if ret != 0:
    raise ValueError('Socket connection failed.')

# List all supported measurements in the REPL
myDso.meas.help()

# Perform automated measurements on input sources.
vmax = myDso.meas.get_max(kCH1)
freq = myDso.meas.get_frequency(kCH1)
phase = myDso.meas.get_phase(kCH1, kCH2)
vpp_math = myDso.meas.get_vpp(kMATH1)

# Control of active measurements
myDso.meas.update() # update from current active measurements
myDso.meas.remove_all() # Clean up all active measurements
myDso.meas.add(1, 'max', kCH1)
myDso.meas.add(2, 'phase', kCH1, kCH2)
phase_diff = myDso.meas._value(2)
myDso.meas.remove(1)
class dso_meas.Measure(parent=None)

Bases: object

This module controls the automated measurement function on the DSO.

add(item: int, meas: str, *args) None

Add new measurment items or change existing ones.

Parameters:
  • item (int) – measurement of interested ranges in 1 to a maximum item, which is 8 by default.

  • meas (str) – index key for a given measurement defined in dso_meas.Measure.all_measures.

  • args (int) – source(s) with respect to a given measurement above. See dso_meas.Measure.supported_sources.

Raises:

MeasureError – An error occurred parsing the input argument.

get_amplitude(*args, precision: str | None = None)
get_area(*args, precision: str | None = None)
get_cyclearea(*args, precision: str | None = None)
get_cyclemean(*args, precision: str | None = None)
get_cyclerms(*args, precision: str | None = None)
get_fallovershoot(*args, precision: str | None = None)
get_fallpreshoot(*args, precision: str | None = None)
get_falltime(*args, precision: str | None = None)
get_fff(*args, precision: str | None = None)
get_ffr(*args, precision: str | None = None)
get_flickindex(*args, precision: str | None = None)
get_flickindex_percent(*args, precision: str | None = None)
get_frequency(*args, precision: str | None = None)
get_frf(*args, precision: str | None = None)
get_frr(*args, precision: str | None = None)
get_high(*args, precision: str | None = None)
get_lff(*args, precision: str | None = None)
get_lfr(*args, precision: str | None = None)
get_low(*args, precision: str | None = None)
get_lrf(*args, precision: str | None = None)
get_lrr(*args, precision: str | None = None)
get_max(*args, precision: str | None = None)
get_mean(*args, precision: str | None = None)
get_min(*args, precision: str | None = None)
get_neg_edge(*args, precision: str | None = None)
get_neg_pulse(*args, precision: str | None = None)
get_neg_width(*args, precision: str | None = None)
get_period(*args, precision: str | None = None)
get_phase(*args, precision: str | None = None)
get_pos_duty(*args, precision: str | None = None)
get_pos_edge(*args, precision: str | None = None)
get_pos_pulse(*args, precision: str | None = None)
get_pos_width(*args, precision: str | None = None)
get_reference_levels(unit: str = 'percent') dict

Get reference settings for measurements.

Returns:

settings in a dict form.

Return type:

_levels (dict)

Raises:

MeasureError – An error occurred parsing the input argument.

get_riseovershoot(*args, precision: str | None = None)
get_risepreshoot(*args, precision: str | None = None)
get_risetime(*args, precision: str | None = None)
get_rms(*args, precision: str | None = None)
get_vpp(*args, precision: str | None = None)
static help()

Show all available measurements

is_on(item: int) bool

Check state of a given measurement item.

Parameters:

item (int) – measurement of interested ranges in 1 to a maximum item, which is 8 by default.

Returns:

True if the state of a given measurement is ‘ON’ else False

remove(item: int) None

Remove existing measurment items

Parameters:

item (int) – measurement of interested ranges in 1 to a maximum item, which is 8 by default.

Raises:

MeasureError – An error occurred for non-existed items.

remove_all() None

Remove all active measurements on the instrument.

reset_reference_levels(unit: str = 'percent') None

Set reference levels to defaults.

Parameters:

unit (str, optional) – unit of reference levels

Raises:

MeasureError – An error occurred parsing the input argument.

set_reference_levels(rlvls: dict, unit: str = 'percent') None

Setup reference levels in a dict form.

Parameters:
  • rlvls (dict) – reference levels

  • unit (str, optional) – unit of reference levels

Raises:

MeasureError – An error occurred parsing the input argument.

update() None

Update the instance with active measurements on the instrument.

exception dso_meas.MeasureError

Bases: Exception

dso_meas.remove_measure_all(mobj) None

Remove all active measurements from a instance of Measure.

Parameters:

mobj (Measure) – target instance for the update.

dso_meas.update_measure(mobj) None

Update a instance of Measure with active measurements on the instrument.

Parameters:

mobj (Measure) – target instance for the update.