Running on Linux and writing in Python and wondering what's the best way to scan for attached Phidget sensors and retrieve their serial numbers.
There can be a number of sensors attached and they are managed by a number of different programs executing on the system. So if I have sensors A, B and C, of which Sensor A is being monitored by program_A and sensor B is being monitored by program_B, but C is not currently being used by any Program, can I scan the environment for Sensor C or alternatively for all three sensors and find in the results that C is free.
I know there's the attach and detach handlers and that's what I'm currently using. Just executing a short Python program which runs the attach handler and prints any results, but I'm not sure that's a reliable method as yet, early days. If C is already attached to the Computer when I run the attached scan will I get it, or is that even only intended to trigger when the sensor is physically attached to the computer?
Been searching for a better solution but so far haven't found a winner. Thanks for any advice.
Sounds like you're looking for the Phidget Manager. It will detect any Phidgets that are connected and disconnected from your PC (and network, if configured).
- The manager won't directly tell you if a Phidget is in use, just that it is present on your machine. You would still have to try opening it to see if it is actually available.
jdecoux wrote: Mon Jun 27, 2022 10:03 am
Sounds like you're looking for the Phidget Manager. It will detect any Phidgets that are connected and disconnected from your PC (and network, if configured).
- The manager won't directly tell you if a Phidget is in use, just that it is present on your machine. You would still have to try opening it to see if it is actually available.
hello,
if the manager doesn't tell you if a phidget is in use, then how can I tell if it's in use?
I believe you can check the "IsOpen" property from the channel in question in the Manager, which should tell you whether or not Open has been called on it