1.2.7. Tektronix Oscilloscopes: wanglib.instruments.tektronix

Interfaces to Tektronix oscilloscopes.

class wanglib.instruments.tektronix.TDS3000(bus=None)

A Tektronix oscilloscope from the TDS3000 series.

Can be controlled over GPIB, RS-232, or Ethernet. Just pass an object with write, read, and ask methods to the constructor.

>>> from wanglib.util import Serial
>>> bus = Serial('/dev/ttyS0', rtscts=True)
>>> scope = tds3000(bus)

If using RS-232 (as above), be sure to use rtscts, and connect using a null modem cable. You will probably need to use the highest baud rate you can.

acquire = {}
acquire_restart()

Discards collected data and restarts acquisition.

data_source

Determines the default data curve returned by get_curve().

Possible values include CH1, CH2, CH3, CH4, MATH, MATH1 (same as MATH), REF1, REF2, REF3, and REF4.

get_curve(source=None)

Fetch a trace.

Parameters:source – Channel to retrieve. Defaults to value of data_source. Valid channels are CH1, CH2, CH3, CH4, MATH, MATH1 (same as MATH), REF1, REF2, REF3, or REF4.
Returns:A numpy array representing the current waveform.
get_timediv()

Get time per division, in seconds.

Returns:Seconds per division, as a floating-point number.
get_wfm(source=None)

Fetch a trace, scaled to actual units.

Parameters:source – Channel to retrieve. Defaults to value of data_source. Valid channels are CH1, CH2, CH3, CH4, MATH, MATH1 (same as MATH), REF1, REF2, REF3, or REF4.
Returns:Two numpy arrays: t and y
is_active(channel)

Ask whether a given waveform is active

Parameters:channelCH1, CH2, CH3, CH4,

MATH, MATH1 (same as MATH), REF1, REF2, REF3, or REF4.

save_wfm(source, dest)

Store a waveform locally on the oscilloscope.

Parameters:
  • source (str) – channel to transfer data from. CH<x>, MATH<x>, or REF<x>.
  • dest (str) – Which one of the four REF<x> to save into.
set_timediv(to)

Set time per division, in seconds.

Parameters:to (float) – Desired seconds per division. Acceptable values range from 10 seconds to 1, 2, or 4ns, depending on model, in a 1-2-4 sequence.
timediv

Get time per division, in seconds.

Returns:Seconds per division, as a floating-point number.