The PCANBasic DLL provides an easy to use API (Application Programming Interface) for all PCAN interfaces from PEAK-System Technik, Darmstadt. For the realization of multi-vendor applications UV Software provides a CAN API V3 compatible wrapper library build upon PEAK´s PCANBasic DLL.
CAN API V3 Wrapper
CAN API V3 is a wrapper specification by UV Software to have a uniform CAN Interface API for various CAN interfaces from different vendors running under multiple operating systems. The PCANBasic wrapper library provides a CAN API V3 compatible API for PEAK´s PCANBasic DLL on Windows.
The GitHub repository contains the source code for the PCANBasic wrapper library and several alternatives to build dynamic link libraries, either as a C++ class library (uvPeakCAN.dll), or as a CAN API V3 wrapper library (u3canpcb.dll), as well as some example programs and my beloved CAN utilities
Note: UV Software also provides a CAN API V3 compatible Wrapper Library for macOS.
|CAN 2.0||Classical CAN|
|CAN FD||Flexible Data-rate CAN|
|Bit-rate, CAN 2.0||high speed: up to 1 Mbps|
|Bit-rate, CAN FD||nominal: up to 1 Mbps
data phase: up to 8 Mbps
|11-bit identifier (STD)||CAN 2.0 and CAN FD|
|29-bit identifier (XTD)||CAN 2.0 and CAN FD|
|Remote frames (RTR)||CAN 2.0 only|
|Error frames (ERR)||CAN 2.0 and CAN FD|
|Error indicator (ESI)||CAN FD only|
|Bit-rate switching (BRS)||CAN FD only|
|Silent operation (MON)||CAN 2.0 and CAN FD|
|Identifier filtering||CAN 2.0 and CAN FD|
|- Monitor mode enable/disable (MON)||disabled by default|
|- Error frames enable/disable (ERR)||disabled by default|
|- Remote frames disable/enable (NRTR)||not supported|
|- Extended frames disable/enable (NXTD)||not supported|
|- Shared access enable/disable (SHRD)||not supported|
|- Non-ISO CAN FD enable/disable (NISO)||HW settings of the device cannot be changed by the library|
|- Bit-rate switching enable/disable (BRSE)||disabled by default|
|- CAN FD operation enable/disable (FDOE)||disabled by default|
|- Pre-defined bit-timing indexes||acc. CiA CANopen specification|
|- BTR register values||register fields:
|- Message queue (FIFO)||queue size depends on the hardware|
|- Polling||return immediately|
|- Timed out||wait up to 65’534 milliseconds|
|- Blocking read||wait infinitely|
|- Acknowledged write||not supported|
|- Buffered write||buffer size depends on the hardware|
|Software Development Kit:|
|- CAN API V3||C API and C++ API by UV Software|
|- Dynamic link library||
|- Static library||
|- 32-bit version (x86)||supported|
|- 64-bit version (x64)||supported|
|- Source code||BDS-2-Clause or GPL-3.0-or-later|
|- Python wrapper||Python 3.7|
|- macOS wrapper||macOS Driver and SDK|
|- Utilities||CLI utilities
|- Examples||C, C++, Python|
- Updated to PCANBasic DLL version 4.5.4
- Switched to a dual-license: BSD-2-Clause OR GPL-3.0-or-later
- Added a check operation mode bit
- Added a check for valid identifier range in
- Added a check for valid messages flags in
- Added a check for operation capability in
- Fixed an out-of-bound violation in companion module
- Fixed a but with casting from CAN API channel to PCAN handle
- Fixed a mistake with channel name displayed instead of device name
- Repaired the C++ examples; Python examples are still broken
- Applied changes from CAN API V3 specification (rev. 951 to 987)
- Added C++ class
CPeakCANderived from abstract class
- Reworked the trial program (it is now based on class
- Reorganized the entire folder structure of the repository
- Added my beloved CAN utilities
- Added two simple C++ examples for sending and receiving CAN frames
- Added a Python wrapper and two Python examples
- Added a Doxygen configuration
- Last sources from subversion repo to build version 3.3 (old versioning scheme)
For a list of supported device see PEAK´s website.
Known Bugs and Caveats
For a list of known bugs and caveats see tab Issues in the GitHub repo.
This work is dual-licensed under the terms of the BSD 2-Clause “Simplified” License and under the terms of the GNU General Public License v3.0 (or any later version). You can choose between one of them if you use this work in whole or in part.
Windows is a registered trademark of Microsoft Corporation in the United States and/or other countries.
Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries.
PCAN is a registered trademark of PEAK-System Technik GmbH, Darmstadt, Germany.
All other company, product and service names mentioned herein are trademarks, registered trademarks or service marks of their respective owners.
If you connect your CAN device to a real CAN network when using this library, you might damage your application.