Anyone used Python for GPIB instrument control?

Suchandra Thapa ssthapa at midway.uchicago.edu
Sat Jul 8 14:22:20 EDT 2000


europax at home.com <europax at home.com> wrote:
>Hello all,
>
>I am new to this ng and to Python.  I am wondering if anyone has used
>Python to control a National Instruments GPIB card on a Windows NT box? 
>I've searched and found a couple of references on my own.
>
>A group at work is using Perl for this task and there is some pressure
>to go along with them.  I've tried Perl, and frankly, assembly language
>is clearer than Perl code to me.  However, Python passed my test as I
>was able to do something with it in the first minute-  and I can
>understand what most of the syntax means.

    I'm not sure if an equivalent exists for windows but try look 
swig.  It allows you to use c/c++ code within python.  From what
I remember from using a GPIB interface to a Tektronics scope, you
don't need much more than some basic c code to accept a string or a 
pointer to a buffer and pass it on to the driver.  You also need a 
function to get a return code and pass it back to your python code.  
    Although I'm not familiar with them, I think you may be able to
write a basic COM/ActiveX object and use it in your python code. 
    How is the rest of your group controling the GPIB in perl?  You
may be able to use the same methods in python.


-- 
------------------------------------------------------------------

Suchandra S. Thapa 
s-thapa at uchicago.edu

------------------------------------------------------------------



More information about the Python-list mailing list