Did you set an error handler? There's already EPHIDGET_BUSY (Error 0x09) for this. This is what it looks like when you print the error string:
Code: Select all
Code: EEPHIDGET_BUSY
Description: Local device: <TMP1200 (RTD Phidget) v108 -> HUB0000 Port:0 S/N:561013> open failed because device is in use. Check that the Phidget is not already open in another program, such as the Phidget Control Panel, or another program you are developing.
Also if you're catching exceptions in your code, the Timeout exception will tell you if a matching device exists but is busy:
Code: Select all
Traceback (most recent call last):
File "error.py", line 28, in <module>
main()
File "error.py", line 19, in main
temperatureSensor0.openWaitForAttachment(5000)
File "C:\Python27\lib\site-packages\Phidget22\Phidget.py", line 551, in openWaitForAttachment
raise PhidgetException(result)
Phidget22.PhidgetException.PhidgetException: PhidgetException 0x03 (Timed Out)
Local device: <TMP1200 (RTD Phidget) v108 -> HUB0000 Port:0 S/N:561013> open failed because device is in use. Check that the Phidget is not already open in another program, such as the Phidget Control Panel, or another program you are developing.