Multiple PCAN-USB with PCAN-Light

CAN Software API for Windows®. REGARD! This API is out-dated. Please use PCAN-Basic for new software developments.
Post Reply
User avatar
StevenP
Posts: 3
Joined: Thu 24. Jul 2014, 09:16

Multiple PCAN-USB with PCAN-Light

Post by StevenP » Thu 24. Jul 2014, 09:32

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.

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1190
Joined: Fri 10. Sep 2010, 19:34

Re: Multiple PCAN-USB with PCAN-Light

Post by U.Wilhelm » Thu 24. Jul 2014, 10:31

Please see here LINK
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

User avatar
StevenP
Posts: 3
Joined: Thu 24. Jul 2014, 09:16

Re: Multiple PCAN-USB with PCAN-Light

Post by StevenP » Thu 24. Jul 2014, 11:46

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.

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1190
Joined: Fri 10. Sep 2010, 19:34

Re: Multiple PCAN-USB with PCAN-Light

Post by U.Wilhelm » Thu 24. Jul 2014, 11:58

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.)
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

User avatar
StevenP
Posts: 3
Joined: Thu 24. Jul 2014, 09:16

Re: Multiple PCAN-USB with PCAN-Light

Post by StevenP » Thu 24. Jul 2014, 12:11

Thanks for the very useful info! I will give that a try and probably move to PCAN-Basic too. :D

Post Reply