- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I have more FX3 conncted to the same machine and I need to connect to a specific one.
Normally, to look for a specific device by its serial number, I would do something like this:
CCyUSBDevice device;
const unsigned char num_of_devices = device.DeviceCount();
for (unsigned char i = 0; i < num_of_devices; i++)
{
device.Open(i);
if (check(device.SerialNumber))
break;
device.Close();
}
// Do something with the device
device.Close()
However, in my case I cannot sequentially open all the connected devices. I need to query WMI database, get a list of all CYUSB3 connected devices and then open a specific one. My problem is that the order of the CYUSB3 devices that I get from WMI database is different from the Cypress driver order.
Is there a way to predict how the Cypress driver (or library) will enumerate my devices (e.g. order by serial, PID, description...) in order to avoid a sequential device scan?
Thank you,
Gianni
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Gianni,
Please use the function defined in this KBA: Accessing Multiple USB-Serial Devices using the Device Instance Path – KBA228257
1. You can assign a serial number to each FX3 Device as mentioned in this KBA: Distinguishing Different FX3 Devices with Same VID/PID on Host Application – KBA225775
2. Get the number of FX3 devices connected using the DeviceCount( ) API.
3. Iterate through the all of the connected FX3 devices and retrieve the instance path using the function GetDevicePath(int deviceNumber) mentioned in this KBA: Accessing Multiple USB-Serial Devices using the Device Instance Path – KBA228257
4. Extract the serial number part from the instance path string.
5. if the serial number matches, you can use the device number to open the respective device using the Open() function.
Please let me know if you have any queries regarding implementing the above?
Thanks,
Yatheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Gianni,
Please use the function defined in this KBA: Accessing Multiple USB-Serial Devices using the Device Instance Path – KBA228257
1. You can assign a serial number to each FX3 Device as mentioned in this KBA: Distinguishing Different FX3 Devices with Same VID/PID on Host Application – KBA225775
2. Get the number of FX3 devices connected using the DeviceCount( ) API.
3. Iterate through the all of the connected FX3 devices and retrieve the instance path using the function GetDevicePath(int deviceNumber) mentioned in this KBA: Accessing Multiple USB-Serial Devices using the Device Instance Path – KBA228257
4. Extract the serial number part from the instance path string.
5. if the serial number matches, you can use the device number to open the respective device using the Open() function.
Please let me know if you have any queries regarding implementing the above?
Thanks,
Yatheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello YatheeshK_36,
Thank you very much for your reply, it was very useful. I was able to retrieve all the device information using the functions of the setupapi library that I found in the first link.
Regards,
Gianni