Tektronix.Oscilloscope

Code author: Kevin Kennedy <protonyx@users.noreply.github.com>

Supported Interfaces

  • USB
  • Ethernet (2000 Series requires the DPO2CONN Module)

Ethernet Interface

Tektronix oscilloscopes support Ethernet communication using the VXI extensions for VISA. The VISA driver should be used to detect the oscilloscope on the network, it is outside of the capabilities of the Labtronyx framework to discover VXI devices. For 2000 series oscilloscopes, the DPO2CONN Connectivity Module is required for ethernet communication.

5000, 7000 and 70000 Series Limitations

The oscilloscopes supported by this driver all run Windows and do not support the HARD COPY command to get screenshot data from the oscilloscope application. Screenshots can be saved to the oscilloscope hard drive and must be retrieved using other means.

class labtronyx.drivers.Tektronix.Oscilloscope.d_2XXX(resource, **kwargs)[source]

Driver for Tektronix 2000 Series Oscilloscopes

getEnabledWaveforms()[source]

Get a list of the enabled waveforms.

Example:

>> scope.getEnabledWaveforms()
['CH1', 'CH3']
Returns:list
getWaveform()[source]

Get the waveform data from the oscilloscope

saveScreenshot(filename, format='PNG')[source]

Save a screenshot of the oscilloscope to a file on the local computer.

Parameters:
  • filename (str) – File to save
  • format – File format (‘PNG’, ‘BMP’ or ‘TIFF’)
statusBusy()[source]

Queries the scope to find out if it is busy

Returns:bool - True if Busy, False if not Busy
waitUntilReady(interval=1.0, timeout=10.0)[source]

Poll the oscilloscope until ready or until timeout seconds has passed

Parameters:
  • interval (float) – Polling interval in seconds
  • timeout (float) – Seconds until timeout occurs
Returns:

bool - True if instrument becomes ready, False if timeout occurs

class labtronyx.drivers.Tektronix.Oscilloscope.d_5XXX7XXX(resource, **kwargs)[source]

Driver for Tektronix 5000, 7000 and 70000 Series Oscilloscopes

defaultSetup()[source]

Resets the Oscilloscope to the Default Setup

exportWaveform(**kwargs)[source]

Export the oscilloscope waveform to a .csv file.

Parameters:Filename (str) – Filename of output file
Returns:bool - True if successful, False otherwise
getEnabledWaveforms()[source]

Get a list of the enabled waveforms.

Example:

>> scope.getEnabledWaveforms()
['CH1', 'CH3']
Returns:list
getPackedWaveform(ch)[source]

Get packed binary waveform data for a given channel

Parameters:ch (str) – Channel - [‘CH1’, ‘CH2’, ‘CH3’, ‘CH4’]
Returns:binary data
getProbeInformation(**kwargs)[source]

Get Probe Data

Parameters:Waveform (str) – Channel - [‘CH1’, ‘CH2’, ‘CH3’, ‘CH4’]
Returns:dict

Returned data has the following keys:

  • ‘Type’ - Probe Type
  • ‘Serial’ - Serial Number
  • ‘Range’ - Attenuation Range
  • ‘Resistance’ - Probe Resistance
  • ‘Units’ - Measurement Units (Volts or Amps)
getSearchMarks(**kwargs)[source]

Get a list of all mark locations. Manually iterates through all marks on the oscilloscope and gets the location.

Warning

Depending on the number of marks, this function can take some time to complete

Parameters:Search (int between 1-8) – Search slot number
Returns:list of mark times (float)
getWaveform()[source]

Refreshes the raw waveform data from the oscilloscope.

Returns:bool - True if successful, False otherwise
lock()[source]

Lock the oscilloscope

saveScreenshot(**kwargs)[source]

Save a screenshot of the oscilloscope display onto the oscilloscope.

Parameters:
  • Filename (str) – Relative or absolute filename
  • Format (str) – File format - [‘BMP’, ‘JPEG’, ‘PCX’, ‘PNG’, ‘TIFF’]
  • Palette (str) – Color Palette - [‘COLOR’, ‘INKSAVER’, ‘BLACKANDWHITE’]
Returns:

bool - True if successful, False otherwise

setAcquisitionSetup(**kwargs)[source]

Set Acquisition Modes

Note

Not all features are available on all models

Parameters:
  • State (str) – Run state - [‘SINGLE’, ‘OFF’, ‘ON’, ‘RUN’, ‘STOP’]
  • FastAcq (str) – Fast Acquisition Mode - [‘ON’, ‘OFF’]
  • MagniVu (str) – MagniVu Mode - [‘ON’, ‘OFF’]
  • Mode (str) – Operating Mode - [‘Sample’, ‘PeakDetect’, ‘HighResolution’, ‘Average’, ‘WaveformDB’, ‘Envelope’]
  • Number (int) – Number of samples when Mode is ‘Average’ or ‘Envelope’
  • RollMode (str) – Horizontal Roll Mode - [‘AUTO’, ‘ON’, ‘OFF’]
  • SamplingMode (str) – Sampling Mode - [‘RealTime’, ‘Equivalent’, ‘Interpolate’]

Operating Modes:

'Sample' specifies that the displayed data point value is the first sampled value
that is taken during the acquisition interval. In sample mode, all waveform data
has 8 bits of precision. You can request 16 bit data with a CURVe query but the
lower-order 8 bits of data will be zero. SAMple is the default mode.

'PeakDetect' specifies the display of high-low range of the samples taken from a
single waveform acquisition. The high-low range is displayed as a vertical column
that extends from the highest to the lowest value sampled during the acquisition
interval. PEAKdetect mode can reveal the presence of aliasing or narrow spikes.

'HighResolution' specifies Hi Res mode where the displayed data point value is the
average of all the samples taken during the acquisition interval. This is a form
of averaging, where the average comes from a single waveform acquisition. The number
of samples taken during the acquisition interval determines the number of
data values that compose the average.

'Average' specifies averaging mode, in which the resulting waveform shows an
average of SAMple data points from several separate waveform acquisitions. The
instrument processes the number of waveforms you specify into the acquired
waveform, creating a running exponential average of the input signal. The number
of waveform acquisitions that go into making up the average waveform is set or
queried using the ACQuire:NUMEnv command.

'WaveformDB' (Waveform Database) mode acquires and displays a waveform pixmap. A
pixmap is the accumulation of one or more acquisitions.

'Envelope' specifies envelope mode, where the resulting waveform shows the
PeakDetect range of data points from several separate waveform acquisitions.
The number of waveform acquisitions that go into making up the envelope
waveform is set or queried using the ACQuire:NUMEnv command.

The instrument acquires data after each trigger event using Sample mode; it then
determines the pix map location of each sample point and accumulates it with
stored data from previous acquisitions.
A Pix map is a two dimensional array. The value at each point in the array is
a counter that reflects the hit intensity. Infinite and noninfinite persist display
modes affect how pix maps are accumulated. Zoom, Math, FastAcq, FastFrame,
XY, Roll, and Interpolated Time (IT) Sampling Mode are conflicting features to
WFMDB acqMode. Turning on one of them generally turns the other one off.
Selection of some standard masks (for example, eye masks, which require option
MTM) changes the acquisition mode to WFMDB.
setCursorSetup(**kwargs)[source]

Set cursor configuration.

Parameters:
  • Type (str) – Cursor Type - [‘HBARS’, ‘VBARS’, ‘SCREEN’, ‘WAVEFORM’]
  • Display (str) – Display Cursors - [‘ON’, ‘OFF’]
  • Mode (str) – Cursor Mode - [‘Track’, ‘Independent’]
  • LineStyle (str) – Cursor Line Style - [‘DASHED’, ‘SDASHED’, ‘SOLID’]
  • Source1 (str) – Waveform for Source1 - [‘CH1’, ‘CH2’, ‘CH3’, ‘CH4’, ‘MATH1’, ‘MATH2’, ‘MATH3’, ‘MATH4’, ‘REF1’, ‘REF2’, ‘REF3’, ‘REF4’]
  • Source2 (str) – Waveform for Source2 - [‘CH1’, ‘CH2’, ‘CH3’, ‘CH4’, ‘MATH1’, ‘MATH2’, ‘MATH3’, ‘MATH4’, ‘REF1’, ‘REF2’, ‘REF3’, ‘REF4’]
  • Pos1 (int or float) – Pos1 in ‘HBARS’, ‘VBARS’ or ‘WAVEFORM’ Mode
  • Pos2 (int or float) – Pos2 in ‘HBARS’, ‘VBARS’ or ‘WAVEFORM’ Mode
  • X1 (int or float) – X1 in ‘SCREEN’ Mode
  • X2 (int or float) – X2 in ‘SCREEN’ Mode
  • Y1 (int or float) – Y1 in ‘SCREEN’ Mode
  • Y2 (int or float) – Y2 in ‘SCREEN’ Mode
  • Style (str) – Cursor Style in ‘SCREEN’ Mode - [‘LINE_X’, ‘LINES’, ‘X’]
Returns:

bool - True if successful, False otherwise

setHorizontalSetup(**kwargs)[source]

Set Horizontal configuration

Parameters:
  • Mode (str) – Horizontal Mode - [‘AUTO’, ‘CONSTANT’, ‘MANUAL’]
  • SampleRate (float) – Samples per second
  • Scale (float) – Horizontal scale
  • Position (int between 0-100) – Horizontal Position - Percentage of screen
setSearchSetup(**kwargs)[source]

Set Search configuration

Parameters:
  • Search (int between 1-8) – Search slot number
  • Type (str) – Search type - [‘TRANSITION’]
  • Enable (str) – Enable Search - [‘OFF’, ‘ON’]
Returns:

bool - True if successful, False otherwise

Note

Only ‘TRANSITION’ Search Type is supported right now. The full range of possible Search Types are: [‘EDGE’, ‘RUNT’, ‘TRANSITION’, ‘PATTERN’, ‘GLITCH’, ‘SETHOLD’, ‘UNDEFINED’, WIDTH’, ‘TIMEOUT’, ‘WINDOW’, ‘STATE’, ‘DDRREAD’, ‘DDRWRITE’, ‘DDRREADWRITE’]

Parameters for ‘TRANSITION’ Search Type:

  • ‘Source’ (str) - Channel source to search - [‘CH1’, ‘CH2’, ‘CH3’, ‘CH4’, ‘REF1’, ‘REF2’, ‘REF3’, ‘REF4’, ‘MATH1’, ‘MATH2’, ‘MATH3’, ‘MATH4’]
  • ‘Delta’ (float) - Time delta to limit matches
  • ‘HighThreshold’ (float) - High Threshold level
  • ‘LowThreshold’ (float) - Low Threshold level
  • ‘Slope’ (str) - Polarity setting for mark placement - [‘EITHER’, ‘NEGATIVE’, ‘POSITIVE’]
  • ‘Transition’ (str) - Transition Trigger Condition - [‘FASTERTHAN’, ‘SLOWERTHAN’]
setTriggerSetup(**kwargs)[source]

Set Trigger Configuration

Note

Only a small subset of the trigger types are supported right now.

Parameters:
  • Type (str) – Trigger Type - [‘EDGE’, ‘TRANSITION’]
  • Source (str) – Trigger Source - [‘CH1’, ‘CH2’, ‘CH3’, ‘CH4’, ‘REF1’, ‘REF2’, ‘REF3’, ‘REF4’, ‘MATH1’, ‘MATH2’, ‘MATH3’, ‘MATH4’]
  • Slope (str) – Edge to trigger on - [‘RISE’, ‘FALL’, ‘EITHER’]
  • Level (float) – Level to trigger on
setVerticalSetup(**kwargs)[source]

Set Vertical Configuration

Parameters:
  • Waveform (str) – Channel - [‘CH1’, ‘CH2’, ‘CH3’, ‘CH4’, ‘REF1’, ‘REF2’, ‘REF3’, ‘REF4’, ‘MATH1’, ‘MATH2’, ‘MATH3’, ‘MATH4’]
  • Display (str) – Display Channel - [‘ON’, ‘OFF’]
  • Label (str) – Channel Label
  • Position (float) – Vertical Position of channel - divisions above or below center
  • Scale (float) – Channel Vertical scale
  • Coupling (str) – Input Attenuator Coupling Setting - [‘AC’, ‘DC’, ‘DCREJECT’, ‘GND’]
  • Deskew (float) – Channel Deskew time (seconds)
  • Bandwidth (str) – Low-Pass Bandwidth Limit Filter (Megahertz) - [‘FIVE’, ‘FULL’, ‘TWENTY’, ‘ONEFIFTY’, ‘TWOFIFTY’]
singleAcquisition()[source]

Put the Oscilloscope into Single Acquisition mode

statusBusy()[source]

Queries the scope to find out if it is busy

Returns:bool - True if Busy, False if not Busy
unlock()[source]

Unlock the oscilloscope

waitUntilReady(interval=1.0, timeout=10.0)[source]

Poll the oscilloscope until ready or until timeout seconds has passed

Parameters:
  • interval (float) – Polling interval in seconds
  • timeout (float) – Seconds until timeout occurs
Returns:

bool - True if instrument becomes ready, False if timeout occurs

waveformExport(**kwargs)[source]

Alias for exportWaveform()