PhidgetException

Supporting 2.6 and up
Kyle
Phidgetsian
Posts: 13
Joined: Tue Jun 05, 2018 2:26 pm
Contact:

PhidgetException

Postby Kyle » Wed Mar 20, 2019 8:27 am

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.

jdecoux
Labview Developer
Posts: 90
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: PhidgetException

Postby jdecoux » Wed Mar 20, 2019 1:54 pm

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.

Kyle
Phidgetsian
Posts: 13
Joined: Tue Jun 05, 2018 2:26 pm
Contact:

Re: PhidgetException

Postby Kyle » Tue Mar 26, 2019 9:08 am

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.


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest