Page 1 of 1

CAN_SetDeviceName

Posted: Fri 31. Jul 2015, 15:43
by rampinia
Hello,

My software connect to multiple net simultaneously.
4 net on PCAN_PCI driver and 1 net on PCAN-VIRTUAL.

I'm able to open all the connection without any error by doing call to CAN_SetDeviceName.

But if I connect to the virtual driver last I'm not able to read/write/remove client from the PCA_PCI driver.

My understanding was that once the connection to a net was established no need to switch between driver. Is that different? Do I have to switch between driver according to the network? How does PCAN_Status manage multiple connection on multiple driver?

How to manage such scenario?

Thanks,

Andrea R.

Re: CAN_SetDeviceName

Posted: Fri 31. Jul 2015, 16:21
by M.Maidhof
Hello,

please note, that you switch the canapi2.dll to a different device with that CAN_SetDeviceName API call. All handles (client-, hardware-, net-handles) which you already configured on the one device will not be available on the other device. All handles will be managed by the device driver, and not by the dll.

So you have to call CAN_SetDeviceName on each API call, when you want to use two different devices at the same time (Virtual and PCI).

regards

Michael

Re: CAN_SetDeviceName

Posted: Sun 2. Aug 2015, 09:09
by rampinia
Do you mean that I can do code like below and call it in a loop?

CAN_SetDeviceName('pcan_virtual');
Ret = CAN_read(....);

CAN_SetDeviceName('pcan_pci');
Ret = CAN_read(...);

Thanks

Andrea R.

Re: CAN_SetDeviceName

Posted: Mon 3. Aug 2015, 13:41
by M.Maidhof
Hi,

yes, this will be possible. Note that you have to use the handles, depending on your driver than.

regards

Michael