Skip to main content

Python API for Tektronix Oscillscopes erial interface.

Project description

PyTek provides a python API for interacting with Tektronix oscilloscopes over a serial interface. It currently supports some basic commands for the TDS3000 series of Digital Phosphor Oscilloscopes, especially capturing waveforms and screen shots from the device.

Note

Serial Port not Included

PyTek relies on a thirdparty serial port for communications, specifically one that matches the pyserial API. It is recommended that you simply use pyserial itself.

tl;dr

What?

A python package that gives you an API for interacting with supported Tektronix oscilloscopes over a serial interace.

Install?

$ pip install pytek

Or, from source:

$ python setup.py install

Serial?

We don’t provide a serial port implementation. We suggest, pyserial:

$ pip install pyserial

Examples?

>>> from serial import Serial
>>> from pytek import TDS3k
>>>
>>> port = Serial("COM1", 9600, timeout=1)
>>> tds = TDS3k(port)
>>>
>>>
>>> # Make the scope identify itself.
...
>>> tds.identify()
'TEKTRONIX,TDS 3034,0,CF:91.1CT FV:v2.11 TDS3GM:v1.00 TDS3FFT:v1.00 TDS3TRG:v1.00'
>>>
>>>
>>>
>>> # Capture waveform data
...
>>> waveform = tds.get_waveform(start=100, stop=109)
>>> waveform
<generator object <genexpr> at 0x0238B8A0>
>>
>>> for x,y in waveform:
...     print x, y
...
-0.0045 -0.16
-0.004499 -0.04
-0.004498 -0.04
-0.004497 -0.12
-0.004496 -0.12
-0.004495 -0.08
-0.004494 -0.12
-0.004493 -0.16
-0.004492 -0.2
-0.004491 -0.08
>>>
>>> tds.x_units()
's'
>>> tds.y_units()
'V'
>>>
>>>
>>>
>>> # Grab a screen shot (this will take a few minutes).
...
>>> ofile = open("screenshot.tiff", "wb")
>>> tds.screenshot(ofile, "tiff")
>>>
>>>
>>>
>>>
>>> #Fin.
...
>>> tds.close()
>>>

Dependencies?

You’ll need a serial port interface. See the “Serial?” section, above.

To build the sphinx docs from source (as is), you’ll need the sphinx_rtd_theme:

$ pip install sphinx_rtd_theme

Extras?

PyTek package includes the following extras (optional installs):

serial
Adds pyserial package as a requirement, the recommended serial port interface.
docs
Adds sphinx_rtd_theme package as a requirement, needed for building sphinx docs.

Misc.

Contact Information

This project is currently hosted on bitbucket, at https://bitbucket.org/bmearns/pytek/. The primary author is Brian Mearns: you can contact Brian through bitbucket at https://bitbucket.org/bmearns.

Project details


Release history Release notifications

History Node

2.0.0.1.post9

History Node

2.0.0.0.post8

History Node

1.1.3.0-r7

History Node

1.1.2.0.post6

History Node

1.1.1.0-r5

History Node

1.1.0.2-r4

History Node

1.1.0.1-r2

This version
History Node

1.1.0.0-r2

History Node

1.0.0.0-r1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pytek-1.1.0.0_r2-py2.7.egg (57.2 kB) Copy SHA256 hash SHA256 Egg 2.7 Apr 11, 2014
pytek-1.1.0.0-r2.win32.exe (228.9 kB) Copy SHA256 hash SHA256 Windows Installer any Apr 11, 2014
pytek-1.1.0.0-r2.win32.zip (59.5 kB) Copy SHA256 hash SHA256 Dumb Binary any Apr 11, 2014
pytek-1.1.0.0-r2.zip (54.4 kB) Copy SHA256 hash SHA256 Source None Apr 11, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page