[C++] Incorrect number of devices shown

Hello All,

I’m having a bit of trouble with successfully detecting the number of devices connected to my machine. I have a XEM3001v2 FPGA. Unless I misunderstand, it seems to behave like a bug. This is the code:

[CODE]okFrontPanelDLL_LoadLib(NULL); //returns 1
okCUsbFrontPanel *xem=new okCUsbFrontPanel();
xem->GetDeviceCount() // at this part of the code, the number of devices is successfully returned as 1
xem->GetDeviceListSerial(0); // this also successfully returns the serial of the device

//but after the following code is run
fp->xem->OpenBySerial();
fp->xem->LoadDefaultPLLConfiguration();
//the xem->GetDeviceCount() and xem->GetDeviceListSerial(0); return zero and null, respectively
[/CODE]

My driver version is 2.0.0.0, okFrontPanelDLL.cpp is version 592, my system is 64 bit Win7. I can confirm that this behavior is present in multiple projects.

The issue happens as soon as I hit OpenBySerial. Why is this happening?

Thanks in advance.

From the FrontPanel User’s Manual:

[QUOTE]Platform-Specific Behavior
Windows, Linux, and Mac OS X behave slightly differently with regards to device enumeration
using the FrontPanel API. Under Windows, if any process opens a device (OpenBySerial), that
device will no longer be listed on subsequent calls to GetDeviceCount() from a different process.
On the other hand, Linux and Mac OS X will allow the opened device to be enumerated. It is up
to the user to assure that two processes are not communicating with the same device as this can
lead to data corruption or other failures.[/QUOTE]

Thank you very much for the quick response.