Code Monkey home page Code Monkey logo

pylt's Introduction

What?
======
This is a set of Python classes for communicating with IEEE488/GPIB
instruments which I use in my private lab.

The base class is "pylt" - PYthon LabTools - which defines the generic
API that hides the particular details of getting HPIB working for
this instrument.

As a result, a typical Python script for measuring something can look
almost readable:

	import u2004a

	d = u2004a.u2004a()

	# 1 MHz, -25 dBm, best resolution
	d.config(1e6, -25, 4)

	while True:
		print(d.measure())

Currently two hardware connections are supported:  Prologix USB-GPIB
adapter and direct USBTMC/USB488 connection.


Why?
=====

For those of you who are happy with LabView, etc., this will look
like yet another 1980s rerun.   Now that I've said it, you
don't need to waste email-bandwidth telling anybody that :-)

Yes, I am aware of py-visa and a few other efforts, but I needed
something that worked and found that they generally spent a lot
of code offering things I didn't need or even want.

Be aware that this is not even close to a nice and polished release,
and that you will probably never see one either:  This is a snapshot 
of what I happened to have on my lab-computer right now, and I will
update it as time/need/inspiration strikes.

There is a sort of vision behind it which has matured as I went
along and learned more and more Python, and I will try to move
closer to that as I go.  The best place to spot it is in the
pylt.py file, where the methods all instruments should support
are defaulted.


Prologix.biz USB-GPIB
=====================

The one thing you need to know is that you must tell where to
find your instruments.  

For instance:

        class hp3336c(prologix_usb.gpib_dev):
                def __init__(self, name = "gpib0", adr = 13):

"gpib0" corresponds to /dev/gpib0 (which is where one of my
Prologix USB-GPIB adapters show up), and 13 is the bus address.

There is a nifty multiplexing facility built in, so you can
talk to multiple instruments at a Prologix driven bus at the
same time from the same Python script, without having to
think about it.


USBTMC/USB488
=============

This one caused me no end of pain. What a sucky standard, but
at least it looks like the Agilent U2004A Power Sensor works
reliably now.

You will need py-usb 1.0 and some backend for it; I use libusb.


Getting started
===============

With git installed do:

	cd /some/where
	mkdir pylt
	cd pylt
	git clone git://github.com/bsdphk/pylt.git


Who?
=====

Written by Poul-Henning Kamp, <[email protected]>.


License?
=========

/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <[email protected]> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
 * ----------------------------------------------------------------------------
 */

pylt's People

Contributors

bsdphk avatar petermortensen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.