| 
      
      
      From: Ray S. <ra...@bl...> - 2006-08-24 23:04:26
      
     | 
| Hi all, We have been trying to use the libusb driver to bulk_read from the Ti ads1271 via the pyusb http://pyusb.berlios.de/ wrapper for Python. The problem is that there is some bulkread() miscommunication between the Python app and the Ti USB (implemented in firmware on the MMB0). I have not gotten the Ti data to be collected fault-free via the (required) bulk_read() method after many hours of testing various settings and timings. The Labview demo (using the Labview usb DLL, I assume) has no issues at any speed or settings. I was testing using a 10Hz wave and data rates from 23Ksps to 55Ksps. At low data rates the most compact Python code for bulkRead'ing could read megasamples with few errors, but, the data is inevitably, silently, corrupted. Requiring windows to update the DOS window (giving it focus) has horrible effects on performance of the USB interaction, with loads of reap_async timeout errors as well as silent corruption/data dropping; the data result can also be missing data in the absence of a thrown error. The latter is typical of the wx GUI app I did. The GUI program suffers the same problem, where a GUI with a DOS window is worst. It is evident that libusb/Python falls behind the expectation/requirements of the firmware as something on the PC is interrupted, and the Ti USB just quietly sends it the next data it has. I also tried using ctypes http://starship.python.net/crew/theller/ctypes/ to call the win32 libusb0.dll directly and bypass the pyusb wrapper, but failed to properly construct a device handle/pointer and didn't try more in that direction. The C code I was following was from the win32 package: http://libusb-win32.cvs.sourceforge.net/*checkout*/libusb-win32/libusb/tests/testlibusb_win.c If libusb only worked for me on LINUX, that would be fine also - there are some notable USB implementation differences with Win32, which I don't fully understand. One of them, usb_reap_async(), is what time-out errors often in my programs. (It appears to be waiting when it errors http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/waitforsingleobject.asp but I can't see what ever calls it directly, not even bulk_read(), or why.) System is an AMD Opteron, Python 2.4, libusb 0.1.10.1 Thanks for any insight, Ray |