06-08-2009 08:34 AM
All,
I've started wrapping the DAQmx and other LabVIEW libraries for python using ctypes. I really like doing some things in python and other in LabVIEW, so I'd like to have the same functionality available for both. I've hosted the tiniest bit of code (mostly just proof of concept) on github. Let me know if anyone else would be interested in this. I'd love some help hashing it out.
- Ken
06-09-2009 11:46 AM
Hi Ken,
Have you tried creating a LabVIEW DLL using Application Builder then calling that from Python?
06-09-2009 11:55 AM
06-09-2009 12:50 PM
Hi Ken,
Writing a Python wrapper for the NI-DAQmx C API by hand sounds extremely tedious. Have you looked into automated wrapper generation tools such as SWIG? Even writing your own ad-hoc parser for NIDAQmx.h and generating wrappers from that would probably save you a lot of time.
Another approach would be to use the NI-DAQmx .NET API from IronPython.
Brad
06-09-2009 12:54 PM
Brad,
The thought had crossed my mind, I've been thinking about doing my own auto-generator. I'll check out the .net api as well.
- Ken
07-27-2009 06:50 AM
Hello Ken,
I have used python's ctypeslib with small modifications to wrap most of NI's IVI drivers (NI-FGEN, NI-RFSG, NI-RFSA...). When I find the time, I can check how well this technique can be applied to NI-DAQ.
Best regards
Martin Gustafsson
10-22-2009 08:20 AM
10-22-2009 08:47 PM
12-30-2009 05:06 AM
Hi Thomas L, thanks for the nice work.
I'm a little confused how to use pydaqmx you posted on google code.
Could you be so kind and point to some examples snippets or brief docs ?
Thanks,
lmk@hd
03-15-2010 06:57 AM
Hello,
thanks a lot to the maintainers of daqmxbase-swig (DAQmx wrapper using SWIG) and pydaqmx (ctypes wrapper, for Python only). That's great work, but isn't it actually NI's job to provide good high-level APIs for their hardware for the major programming languages? With Python gaining market share in the experiment control and scientific computing sector, it has become standard for many small DAQ manufacturers to provide python high-level APIs. Any comment on this from NI people? I personally won't go back to LabView after having tried scientific computing with Python. If no good drivers ain't there, I won't buy the silicon...
Thererfore I'd like to encourage NI to provide a nice SWIG wrapper for the DAQmx library (object-oriented would be nice!). It's not that hard, really...
Greetings,
Tobias
http://code.google.com/p/pi3diamond/