Tektronix Oscilloscopes

Driver module for Tektronix oscilloscopes.

exception instrumental.drivers.scopes.tektronix.ClippingError
class instrumental.drivers.scopes.tektronix.Channel(scope, num)
__init__(scope, num)
offset
position
scale
class instrumental.drivers.scopes.tektronix.ChannelProperty
__init__()
facet(facet)
class instrumental.drivers.scopes.tektronix.Channels(scope, facets)
__init__(scope, facets)
class instrumental.drivers.scopes.tektronix.MSO_DPO_2000(inst=None, **kwds)

A Tektronix MSO/DPO 2000 series oscilloscope.

set_min_window(width)
ch
property datetime
max_waveform_length = 1250000
meas
waveform_length

Record length of the source waveform

class instrumental.drivers.scopes.tektronix.MSO_DPO_3000(inst=None, **kwds)

A Tektronix MSO/DPO 3000 series oscilloscope.

property datetime
class instrumental.drivers.scopes.tektronix.MSO_DPO_4000(inst=None, **kwds)

A Tektronix MSO/DPO 4000 series oscilloscope.

property datetime
class instrumental.drivers.scopes.tektronix.StatScope(inst=None, **kwds)
are_measurement_stats_on()

Returns whether measurement statistics are currently enabled

disable_measurement_stats()

Disables measurement statistics

enable_measurement_stats(enable=True)

Enables measurement statistics.

When enabled, measurement statistics are kept track of, including ‘mean’, ‘stddev’, ‘minimum’, ‘maximum’, and ‘nsamps’.

Parameters

enable (bool) – Whether measurement statistics should be enabled

set_measurement_nsamps(nsamps)

Sets the number of samples used to compute measurements.

Parameters

nsamps (int) – Number of samples used to compute measurements

class instrumental.drivers.scopes.tektronix.TDS_1000(inst=None, **kwds)

A Tektronix TDS 1000 series oscilloscope

class instrumental.drivers.scopes.tektronix.TDS_200(inst=None, **kwds)

A Tektronix TDS 200 series oscilloscope

class instrumental.drivers.scopes.tektronix.TDS_2000(inst=None, **kwds)

A Tektronix TDS 2000 series oscilloscope

class instrumental.drivers.scopes.tektronix.TDS_3000(inst=None, **kwds)

A Tektronix TDS 3000 series oscilloscope.

property datetime
max_waveform_length = 10000
waveform_length

Record length of the source waveform

class instrumental.drivers.scopes.tektronix.TDS_7000(inst=None, **kwds)

A Tektronix TDS 7000 series oscilloscope

max_waveform_length = 500000
waveform_length

Record length of the source waveform

class instrumental.drivers.scopes.tektronix.TekScope(inst=None, **kwds)

A base class for Tektronix scopes. Supports at least TDS 3000 series as well as MSO/DPO 4000 series scopes.

async_get_data(channel=1, width=2)

Retrieve a trace from the scope asynchronously.

Pulls data from channel channel and returns it as a tuple (t,y) of unitful arrays. Python >= 3.3 only.

Use within generators/coroutines like this::

t, y = yield from scope.async_get_data(channel=1)

Parameters
  • channel (int, optional) – Channel number to pull trace from. Defaults to channel 1.

  • width (int, optional) – Number of bytes per sample of data pulled from the scope. 1 or 2.

Returns

t, y – Unitful arrays of data from the scope. t is in seconds, while y is in volts.

Return type

pint.Quantity arrays

get_data(channel=1, width=2, bounds=None)

Retrieve a trace from the scope.

Pulls data from channel channel and returns it as a tuple (t,y) of unitful arrays.

Parameters
  • channel (int, optional) – Channel number to pull trace from. Defaults to channel 1.

  • width (int, optional) – Number of bytes per sample of data pulled from the scope. 1 or 2.

  • bounds (tuple of int, optional) – (start, stop) tuple of first and last sample to read. Index starts at 1.

Returns

t, y – Unitful arrays of data from the scope. t is in seconds, while y is in volts.

Return type

pint.Quantity arrays

get_math_function()
measure(channel, meas_type)

Perform immediate measurement.

read_events()

Get a list of events from the Event Queue

Returns

  • A list of (int, str) pairs containing the code and message for each event in the scope’s

  • event queue.

read_measurement_stats(num)

Read the value and statistics of a measurement.

Parameters

num (int) – Number of the measurement to read from, from 1-4

Returns

stats – Dictionary of measurement statistics. Includes value, mean, stddev, minimum, maximum, and nsamps.

Return type

dict

read_measurement_value(num)

Read the value of a measurement.

Parameters

num (int) – Number of the measurement to read from, from 1-4

Returns

value – Value of the measurement

Return type

pint.Quantity

run_acquire()

Sets the acquire state to ‘run’

set_math_function(expr)

Set the expression used by the MATH channel.

Parameters

expr (str) – a string representing the MATH expression, using channel variables CH1, CH2, etc. eg. ‘CH1/CH2+CH3’

set_measurement_params(num, mtype, channel)

Set the parameters for a measurement.

Parameters
  • num (int) – Measurement number to set, from 1-4.

  • mtype (str) – Type of the measurement, e.g. ‘amplitude’

  • channel (int) – Number of the channel to measure.

stop_acquire()

Sets the acquire state to ‘stop’

property channels
horizontal_delay
horizontal_scale
property interface_type
property math_function
property model
instrumental.drivers.scopes.tektronix.ChannelFacet(msg, convert=None, readonly=False, **kwds)
instrumental.drivers.scopes.tektronix.infer_termination(msg_str)
instrumental.drivers.scopes.tektronix.load_csv(filename)

Load CSV data produced by a Tektronix oscilloscope.

Only developed and tested on CSV data generated by a TDS1001B

instrumental.drivers.scopes.tektronix.strstr(value)

Convert to str and strip outer quotes