PCAN-Basic multiple client

The free CAN Software API (Application Programming Interface) for Windows®
Locked
Kraal
Posts: 2
Joined: Fri 13. Mar 2026, 09:14

PCAN-Basic multiple client

Post by Kraal » Fri 13. Mar 2026, 10:52

Hello,

I'm using PCANBASIC v5, same for the device drivers, with PCAN-USB (Classic and FD) dongles.
I'm building a C# application, everything is working as it should.
BUT:
I would like to replicate the PCAN-view behavior, i.e. if the channel is already initialized by my C# application, PCAN-view will just leave the channel initialized as it is, and will be able to interract with the bus (read and write CAN messages).
To make this work, I usually execute first my application, then PCAN-view. If I start PCAN-view first (and connect to the PCAN-USB), my application will complain that the channel is already being used (with the very specific channel condition ChannelPCanView), can't initialize the channel (which is expected), but can't send or receive any CAN messages. The features of PCAN-Basic states here (https://www.peak-system.com/products/so ... can-basic/) that : "Multiple PEAK-System applications and your own can be operated on a physical channel at the same time".
How can I achieve that ?

K.Wagner
Software Development
Software Development
Posts: 1087
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN-Basic multiple client

Post by K.Wagner » Fri 13. Mar 2026, 18:04

Hello,

note that the bit rate used by PCAN-View must passt exactly with those used by PCAN-Basic. PCAN-View may show you for example 500 kBits, but they are a lot of combination for that.
Bitrate500_80Mhz.jpg
Bitrate500_80Mhz.jpg (63.89 KiB) Viewed 7411 times
Now, at the time PCAN-Basic was designed, there were only hardware using bit rate based on the SJA1000 CAN controller. This accepted bit rates for 8MHz in a BTR0-BTR1 format. You need to use the same way, for PCAN-basic to recognize those bit rates as compatible.
SJA1000Mode.jpg
SJA1000Mode.jpg (77.47 KiB) Viewed 7411 times
In the picture you can see the bit rate registers (BTR0-BTR1) for 500 kBit, which would be understood by PCAN-Basic. So if you first conenct PCAN-View with this bit rate, and then you say PCAN-Basic to connect the same channel with bit rate PCAN_BAUD_500K, then it will work.

Other way is to set the parameter PCAN_BITRATE_ADAPTING, to just take that being used. Check the docuemntation for that.
Best regards,
Keneth

Kraal
Posts: 2
Joined: Fri 13. Mar 2026, 09:14

Re: PCAN-Basic multiple client

Post by Kraal » Tue 17. Mar 2026, 10:57

:D
Thank you very much for your help.
Both methods work as expected, and I'm using PCAN_BITRATE_ADAPTING to have a more resilient application.

Have a nice day,
Kraal

K.Wagner
Software Development
Software Development
Posts: 1087
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN-Basic multiple client

Post by K.Wagner » Tue 17. Mar 2026, 11:02

You're welcome!

Closed
Best regards,
Keneth

Locked