[SciPy-user] OT(?): Lab hardware interface

Andrew Straw strawman at astraw.com
Tue Aug 22 13:58:52 CDT 2006


Dear John,

I believe PyUL now has analog output. You must have grabbed an older
version.

I'm of a different opinion about no wrapper being needed. Although I
want the Python API to be as close as possible to the C API, I don't
think one should be forced to manually check for errors when calling
from Python. Thus, the wrapper would essentially do nothing except call
the C function and check for errors. Small, simple, and nearly trivial,
yes. But still a wrapper, nevertheless. And like you say, ctypes makes
this very easy and that's what the next version will be based on.

John Hassler wrote:
> I looked at your PyUL, and would have used it, if it had had analog
> output.  Since it didn't, I started looking deeper into the problem,
> and figured out that you could just use c_types.  There's no "wrapper"
> needed, really ... once you define the .dll, then you just use the UL
> calls, as-is.
>
> I'll be glad to show you what I've done, but really, there's nothing
> complex about it.
> john
>
> Andrew Straw wrote:
>> John Hassler wrote:
>>   
>>> For the USB device (Measurement Computing USB1208) the first part looks 
>>> like:
>>> from ctypes import *
>>>   
>>>     
>> Dear John,
>>
>> I would like to make the next version of PyUniversalLibrary use ctypes
>> (instead of pyrex). Due to time constraints, this is not on my
>> immediate-to-do list, so I have no idea when, if ever, it will happen.
>> If you ever get around to the attempt to make a complete API wrapper for
>> UniversalLibrary, please contact me so we can hopefully collaborate. I
>> will do the same.
>>
>> Cheers!
>> Andrew
>> _______________________________________________
>> SciPy-user mailing list
>> SciPy-user at scipy.org
>> http://projects.scipy.org/mailman/listinfo/scipy-user
>>
>>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>   



More information about the SciPy-user mailing list