[SciPy-user] OT(?): Lab hardware interface
hasslerjc at adelphia.net
Tue Aug 22 11:07:25 CDT 2006
Do you already have the a/d board? If so, what is it?
By some strange coincidence, I've just been working with exactly that
problem - three times. In one, I used an ancient, obsolete ISA board on
an ancient, obsolete computer with Linux, comedi, swig, and Python. For
the other two, I had windows .dll files, and was able to use c_types
with Python to interface directly. One was Ethernet, the other was USB.
For the USB device (Measurement Computing USB1208) the first part looks
from ctypes import *
# Load the cbw32.DLL file
cbw = windll.LoadLibrary('c:\\MCC\\cbw32.dll')
# Define the appropriate c_types
RevNum = c_float(0)
VxDRevNum = c_float(0)
BoardNum = c_int(0)
.... and so on. Then:
err = cbw.cbAIn (BoardNum, Chan, Gain, byref(DataValue))
if err != 0: print "a/d error ", DataValue, err
... and the like. Really very very easy. I love Python.
I can give you more details, if you're interested.
Gary Pajer wrote:
> Soon I'm going to need to interface my experiment to my computer.
> Can any one suggest any python tools that might exist? I've been
> googling for abour an hour, and haven't come up with anything.
> I can't afford LabView at the moment, and besides, I've never used it
> so it doesn't have the advantage of familiarity. I don't need a
> graphical environment. At first the equipment will be very simple: a
> couple of photodiodes, an A/D converter, perhaps a stepper motor controler.
> Any hints are welcome.
> If this strikes you as noise, please accept my apology.
> SciPy-user mailing list
> SciPy-user at scipy.org
More information about the SciPy-user