Multiple instance of one application to communicate with multiple devices

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

I have the following situation:

I use the CyApi.lib to create a handling to an FX3 Chip in my C++ application.

Until now, I have use one FX3 device with on instance of my application.

Now I try to use two instance of my application with two FX3 devices with same PID. I can connect succuessfully to the FX3 device.

Also I can communicate with the different FX3 devices sequentielly perfectly.

But if I try to communicate full parallel to the FX3 devices, so I lost connection to one device.

It is possible to communicate with more as one instance of own applications to more FX3 devices with the same PID.

Feel free to ask, if you have any questions.

Best Regards

Kevin

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi Kevin,

1. The parameter CYUSBDRV_GUID is used to get the handle for the devices which are bound to the cyusb3.sys driver.

2. Do not pass NULL. Instead implement as in the reference 'streamer' source code pointed out.

3. Once USBDevice = new CCyUSBDevice((HANDLE)this->Handle,CYUSBDRV_GUID,true); is called,

You can find howmany devices are connected by accessing the member USBDevice->DeviceCount();

- So based on this count, you need to open right device by calling USBDevice->Open(i);

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
3 Replies
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi Kevin,

Yes, you can communicate to different devices with same VID and PID parallelly. Please refer to the attachment. I have connected two different devices with same VID, PID. One device is streaming 0xAA and other 0xA7.

And I am running two instances of same C++ application.

You can refer to the source code of this application in the following path:

C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\application\cpp\streamer\x86\Release

Regards,

Hemanth

Hemanth
0 Likes
Anonymous
Not applicable

Hi Hemanth,

thank you for your prompt reply!

I have view the source code of the example. A difference, that I have see, is the instantiation of the pointer USBDevice.

In the example is it:

USBDevice = new CCyUSBDevice((HANDLE)this->Handle,CYUSBDRV_GUID,true);

In the API documentation is it only "NULL".  So I have this in my application.

1.) Is it possible, that is the problem?

2.) What handle is necessary? Is this used in the driver or is it just for identification in the driver?

Best Regards

Kevin

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi Kevin,

1. The parameter CYUSBDRV_GUID is used to get the handle for the devices which are bound to the cyusb3.sys driver.

2. Do not pass NULL. Instead implement as in the reference 'streamer' source code pointed out.

3. Once USBDevice = new CCyUSBDevice((HANDLE)this->Handle,CYUSBDRV_GUID,true); is called,

You can find howmany devices are connected by accessing the member USBDevice->DeviceCount();

- So based on this count, you need to open right device by calling USBDevice->Open(i);

Regards,

Hemanth

Hemanth
0 Likes