Page 1 of 1

Phidget22, Attaching to DO device

Posted: Tue Jul 20, 2021 3:33 am
by berkinet
It seems the same client instance can only open a given Digital Output channel once at a time. A second attempt to attach the same device fails with a message like:
  • PhidgetException: PhidgetException 0x34 (Device not Attached)
    This can happen for a number of common reasons. Be sure you are opening the channel before trying to use it. If you are opening the channel, the program may not be waiting for the channel to be attached. If possible use openWaitForAttachment. Otherwise, be sure to check the Attached property of the channel before trying to use it.
This is not a problem per se. However, it would be nice to be able to tell the user the attach failed because they already had another instance of that same device attached.

I also noted that if I try to open the device in another mode, it fails with an appropriate message:
  • PhidgetException: PhidgetException 0x09 (Resource Busy)
    Open was called on a port twice with different port modes. This is not allowed unless hub serial numbers or labels are different.
So, is there anyway to determine if this was the reason for the failure? Perhaps by getting a list of existing attached devices to check against?

Thanks