I'm using the SDK for a Pico 6402C device using C++.
When calling ps6000EnumerateUnits before anything else it reports correctly my device. If I then opens the device using ps6000OpenUnit I get connection and everything is OK.
If I then call ps6000EnumerateUnits again while my device is open it report 0 devices. I would like to automatically detect when a new device is added (or removed) on the USB port while running my device.
Is it correct that ps6000EnumerateUnits will return 0 is a device is opened, or is there a way to enumerate devices when detecting USB deice changes?
The more I use this feature, the more I think it is implemented wrong.
ps6000EnumerateUnits should enumerate all devices no matter what, - opened or closed.
It is not logical that ps6000EnumerateUnits return 0, when a device is clearly connected and opened.
The ps6000EnumerateUnits method is often called in a static call, e.g. a thread monitoring the USB connections, whiteout direct knowledge of existing open pico handles. And as you write, it also requires to make a call using a pico handle, that maybe is invalid, and looking at the error code to figure out if it is still connected.
The ps6000EnumerateUnits method should work without interfering or calling the pico scope.