Open OskarCis opened 8 years ago
Hello, how are you? I did all use of DAQFLEX with C #, because some features were ready with the API. If this is interesting to you please contact me. Francisco de Assis
PyDAQFlex doesn't have a USB_TEMP
class, so you'll have to define one. It's should be pretty simple -- see one of the existing device classes for an example.
Thanks to both, I will try to write the clases for USB_TEMP. I understand that max _counts =0x0FFF for all class, but What about with the id_product? Is it a row?
Thanks to both, I will try to write the class for USB_TEMP. I understand that max _counts =0x0FFF for all class, but What about with the id_product? Is it a row?
The id_product
attribute corresponds to the device's idProduct
device descriptor. It's something you'd have to determine with the device plugged in. On Linux, you can use lsusb -v
to print out this information. I'm not very familiar with other systems, but apparently USBView does something similar for Windows.
Hi ixjlyons, I am using raspbian, I already have defined a USB_TEMP class, but now appears a new issue:
import daqflex dev=daqflex.USB_TEMP()
Traceback (most recent call last):
File "<pyshell#1>", line 1, in
I attached you my device.py I dont know if I have a mistake. Thanks for your help.
This may point to an actual bug in PyDAQFlex, but I'm not sure.
The error comes from pyusb and it may be indicating that a kernel driver is holding on to the device. Reference this issue for what seems to be a similar problem that several people run into.
Could you try the following code and see if it generates an error? It just sets up the device like PyDAQFlex does but detaches the kernel driver if it is active. Replace id_product
with your device's idProduct:
import usb
dev = usb.core.find(idVendor=0x09db, idProduct=id_product)
if dev.is_kernel_driver_active(0):
dev.detach_kernel_driver(0)
dev.set_configuration()
If this works without error, the check should be added before line 70 of devices.py
.
Hi ixjLyons, I had written before because couldn´t try your recommendations. I tried it yesterday and worked. The raspberry pi can setup a USB_Temp device, but when I try to sent a message appears a new issue: This is my code:
import daqflex d=daqflex.USB_TEMP() d.find_serial_numbers() [u' 01923E6E'] d.send_message("AI{0]:VALUE/DEGC") Traceback (most recent call last): File "<pyshell#4>", line1, in
d.send_message("?AI{0]:VALUE/DEGC") File "daqflex/devices.py", line 125, in send_message raise IOError("send failed, possibly wrong command?") IOError:Send failed, possibly wrong command?
Do you know whats the problem?
Regards
@OskarCis: It looks like you've got a typo:
d.send_message("?AI{0]:VALUE/DEGC")
It should read:
d.send_message("?AI{0}:VALUE/DEGC")
I’m sorry, when I typed the past code, I copied this with mistake. Thanks for correcting me. However although correctly type the code still see the error. I attached the picture of my raspberry’s screensaver for you. This is my code:
import daqflex dev=daqflex.USB_TEMP() dev.find_serial_numbers() [u'01923E6E'] dev.send_message("?AI{0}:VALUE/DEGC")
Traceback (most recent call last):
File "<pyshell#3>", line 1, in
Thank you for your help!
@OskarCis: Sorry, this is pretty much the end of my ability to help, since I don't have the hardware. Here are a couple things though:
Hi I am new in Python and PyDAQFlex, I will it with a USB TEMP card of MCC. But when I assign the name of card, I find the issue to see below.
Traceback (most recent call last): File "<pyshell#1>", line 1, in
dev=daqflex.USB_TEMP()
AttributeError: 'module' object has no attribute 'USB_TEMP'
somebody could help me?