Page 1 of 1

PhidgetException

Posted: Wed Mar 20, 2019 8:27 am
by Kyle
Hi there,

I have this code run on my Linux machine. It's running before I did something to the usb settings. (I'm not sure if I changed anything but I suppose this is the reason why it's not running now). Here's the code:

Code: Select all

ch00.setDeviceSerialNumber(serialNumber)
ch00.setChannel(0)
ch00.setOnAttachHandler(onAttachHandler)
ch00.openWaitForAttachment(5000)


The error is given when calling openWaitForAttachmet The error is as follows:

Code: Select all

File"/home/administrator/phidget_ws/src/phidget/src/testone.py", line 51, in main
    ch00.openWaitForAttachment(5000)
File "/usr/local/lib/python2.7/dist-packages/Phidget22/Phidget.py", line 646, in openWaitForAttachment
    raise PhidgetException(result)
Phidget22.PhidgetException.PhidgetException


Since there's no error code, I have no idea how to solve this. Thank you for any suggestions on this.

Re: PhidgetException

Posted: Wed Mar 20, 2019 1:54 pm
by jdecoux
It looks like you're using Python, so you can put a try-except clause around your open call to get the error and description.

You can look at our page about handling errors for more informaiton, and an example.

Re: PhidgetException

Posted: Tue Mar 26, 2019 9:08 am
by Kyle
Hi jdecoux, thank you so much for your help! The error handling page helps me fixed the errors. Cheers!

jdecoux wrote:It looks like you're using Python, so you can put a try-except clause around your open call to get the error and description.

You can look at our page about handling errors for more informaiton, and an example.