COMEDI 2 Python
Realtime data plotting and processing with python for your USB-DUX device.
The USB-DUXsigma showing off its 24 bits resolution.
- No need to write any low level COMEDI code to record asynchronously
- Create data plots within seconds
- Perform data processing with a few commands in Python
What is it?
comedi2py feeds data at a specified sampling rate from your USB-DUX board into python by using call-back functions. The goal was to make this as easy as possible -- hiding all the complexity of COMEDI's asynchronous acquisition in comedi2py and providing the Python program simply with an array of the sampled data at the given sampling rate.
You need to write three python functions for your module:
- comedistart(samplingrate,minRange,maxRange) is called once comedi2py has been started. The samplingrate is the rate at which the callback function comedidata() is called and minRange and maxRange are the minimum and maximum values of the COMEDI device(s).
- comedidata(card1,card2,card3,...) is called periodically at the given sampling rate where every variable card1,...,cardn contains all samples from the corresponding COMEDI device as a stanard python list.
- comedistop() is called when comedi2py is closed.
git clone git://github.com/berndporr/comedi2py.git
- comedi2py-0.7-0.tar.gz source
UBUNTU repository for precise pangolin. Just add "ppa:berndporr/usbdux"
to your package manager or run in the termninal:
sudo add-apt-repository ppa:berndporr/usbdux
Sample python scripts
The tar ball above contains two demo scripts:
- QWTtest.py creates a scrolling Plot window and a thermometer. See screenshot above. Start with
- Simple.py prints the data in the terminal and adds up the values from the 1st channel. Start with
The debian/UBUNTU packages store these files under /usr/share/doc/comedi2py. Copy these files into your home directory and start/modify them there.