Page 1 of 1

Multiple PCAN-USB with PCAN-Light

Posted: Thu 24. Jul 2014, 09:32
by StevenP
We have a working test system using PCAN-USB and the PCAN-Light API/dll controlled by a MS Visual Studio VC++ MFC program. I would like to extend this software to use a second PCAN-USB but do not know how to address the second PCAN-USB module. I know I can set Device-ID using your software tool for each PCAN-USB, from the default 0xFF to something unique for each module. It is not necessary for both PCAN-USB modules work at the same time.

I believe PCAN-Basic can support multiple PCAN-USB modules, but I would prefer not to change the existing working system from PCAN-Light if at all possible! Many thanks for your advice.

Re: Multiple PCAN-USB with PCAN-Light

Posted: Thu 24. Jul 2014, 10:31
by PEAK-Support
Please see here LINK

Re: Multiple PCAN-USB with PCAN-Light

Posted: Thu 24. Jul 2014, 11:46
by StevenP
I just tried the PCAN USB DeviceID edits and PC registry edits described in the post you linked to. But in PCANLight my handle is still unchanged, if that is what is meant by 'HardwareHandle16' in the post?
CANLightDll = GetDllHandle(HWType);
The handle my code gets is still 0x10000000. Or am I misunderstanding something here?
Also the post refers to PCANBasic, not PCAN-Light as I am using?
Thanks in advance for any tips.

Re: Multiple PCAN-USB with PCAN-Light

Posted: Thu 24. Jul 2014, 11:58
by PEAK-Support
You are right, the description was made for the PCAN-Basic API. In this API you could Init a CAN USB channel by using a handle. With the older PCAN-Light API you use, you could not do it this way.

In PCAN-Light you use one DLL for CAN Channel 1 and a second DLL for CAN Channel2

CAN Channel one use always Handle 16
CAN Channel two use always handle 15

if you set the registry keay and use the pcan_usb.dll the driver use handle 16
if you set the registry keay and use the pcan_2usb.dll the driver use handle 15

I hope that explains how it works by using the Light API. If you have the choice to change to the newer PCAN-Basic, please do it. The workload is not so much, because the API is nearly the same, but the PCAN-Basic have a lot of more functions and features as the older (over 10 years) PCAN-Light DLL, and also will be support over the next years (new Windows Versions etc.)

Re: Multiple PCAN-USB with PCAN-Light

Posted: Thu 24. Jul 2014, 12:11
by StevenP
Thanks for the very useful info! I will give that a try and probably move to PCAN-Basic too. :D