macOS Library for PCAN-USB Interfaces
macOS Library for PCAN-USB Interfaces
Developed by UV Software, Berlin.

Running CAN and CAN FD on Mac

The PCBUSB library realizes a CAN to USB user-space driver under macOS for PCAN-USB interfaces from PEAK-System Technik, Darmstadt. It supports up to 8 PCAN-USB and PCAN-USB FD devices. The library offers an easy to use API to read received CAN messages from a 64K message queue and to transmit CAN messages. Standard CAN frames (11-bit identifier) as well as extended CAN frames (29-bit identifier) are supported. The PCAN-USB FD device can be operated in CAN 2.0 and CAN FD mode.

The library comes with an Objective-C wrapper and a demo App: MacCAN Monitor App Furthermore, it can be used with the Qt Serial Bus API on a Mac.

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.
Qt is a registered trademark of The Qt Company Ltd. and its subsidiaries.

All software offered below are freeware without any warranty or support!

Please note the copyright and license agreements.


PCBUSB Library

The PCBUSB library realizes a 'PCAN-USB Driver for macOS' using Apple´s IOUSBKit. The dynamic library libPCBUSB is running under macOS 10.12 and later (x86_64 architecture).

The API is almost compatible to PEAK´s PCANBasic DLL. See the doxygen documentation and the header-file for details.

Version 0.10 (Build 957 of December 22, 2020):

  • Support of PCAN-USB Pro FD devices, but only the first channel (CAN1).
  • Set linker options -install_name, -compatibility_version, and -current_version.
  • Synchronized the API with Peak´s PCANBasic version
  • Updated the Python example: reworked the output format.

Version 0.9 (Build 902 of June 25, 2020):

  • Data types from <MacTypes.h> as replacement for Peak´s usage of Windows BYTE, WORD, DWORD and UINT64 (field CAN ID is now 32-bit wide)
  • Synchronized the API to Peak´s PCANBasic version
  • Parameter PCAN_DEVICE_ID can be read in pre-initialization state
  • Added a delay of 1 usec in CAN_Write to run on macOS 10.15 (Catalina)

Version 0.8 SR1 (Build 787 of September 27, 2019):

  • Adapted trace-file headers to Peak's changes in version

Version 0.8 (Build 689 of September 20, 2017):

  • Support of PCAN-USB FD devices in CAN 2.0 mode (CAN classic) and CAN FD mode!
  • Adapted the API according to Peak's changes in version and harmonized return codes with it.
  • Fixed issue #208 'CAN_Write stuck when errors on the bus are present'.
  • Conducted an intermediate solution for issue #246 (writing into a trace file).
  • Added run-path-relative install name to the library (using the @rpath macro).

Version 0.7 (Build 558 of November 30, 2016):

  • Adapted the API according to Peak's changes in version and harmonized return codes with it.
  • Implemented parameter PCAN_CHANNEL_FEATURE and PCAN_BITRATE_INFO.

Version 0.6 (Build 425 of February 20, 2015):

  • Parameter PCAN_RECEIVE_EVENT returns a file descriptor to realize 'blocking read' by select() as on the Linux implementation of the PCAN-Basic API.
  • Added two C++ examples and one Python example using the PCBUSB library

Version 0.5 (Build 370 of November 23, 2014):

  • Feature 'Reading/Writing of parameter PCAN_DEVICE_NUMBER' implemented.
  • Fixed issue #104 'Hot plugging was not detected by the library/driver'.
  • Fixed issue #117 'Permission for libPCBUSB.x.y.lib wrong' (chmod 755).
  • Return codes of API functions harmonized with PCANBasic.dll (

Version 0.4 (Build 293 of Febuary 23, 2014):

  • Time-stamps are now taken from CAN controller instead of taking them from the system clock.
  • Getting and setting of PCAN_* parameters reworked (to be almost compatible to the PCANBasic DLL, version 1.3).
  • Resetting of RCV queue and XMT queue on the CAN controller realized.

Version 0.3 (Build 235 of November 2, 2013):

  • Fixed issue #11 'All channel initialized by the application will be closed even if they are in use'.
  • CAN_Unitialize: closing all channel initialized by the application at once implemented.
  • CAN_Read: receive queue overrun handling reworked.
  • CAN_*: wrong function return codes corrected.
  • CAN_GetErrorText: language support for English, German, French, Italian and Spanish added.

Version 0.2 (Build 163 of September 8, 2013):

  • Minor changes

Version 0.1 (Build 149 of June 30, 2013):

  • Initial revision

Older versions of the PCBUSB library can be downloaded from here or from GitHub.



 Show doxygen

MacCAN Monitor App

The MacCAN Monitor App is a demo program to show the functionally of the PCBUSB library.

The program displays received CAN messages in a table view; its size is limited to 1024 rows. Furthermore it is possible to send single standard CAN messages with 0 to 8 data bytes.

Version 0.3 (Release of July 2, 2020):

  • Included version 0.9 of the PCBUSB library
  • Check for required version of the PCBUSB library
  • Write to file: trace file instead of log file

Version 0.2 SR4 (Service release of September 21, 2017):

  • Included version 0.8 of the PCBUSB library

Version 0.2 SR3 (Service release of December 1, 2016):

  • Included version 0.7 of the PCBUSB library

Version 0.2 SR2 (Service release of February 21, 2015):

  • Included version 0.6 of the PCBUSB library

Version 0.2 SR1 (Service release of November 24, 2014):

  • Included version 0.5 of the PCBUSB library

Version 0.2 (Release of February 24, 2014):

  • Minor changes (to run with version 0.4 of the PCBUSB library)

Version 0.1 (Release of September 8, 2013):

  • 1st release (demo version)

Older versions of the MacCAN Monitor App can be downloaded from here.

The MacCAN Monitor App is free software, and you are welcome to redistribute it under certain conditions; see file LICENSE for details. Its source code can be found on GitHub



 Play Video

Command-line Tool

If you prefer to work in a terminal session, here is a command-line version of the CAN Monitor application.

The command-line tool 'can_moni' runs as a standalone program, therefor it is not necessary to install the PCBUSB library to run the program.

Version 0.5 SR2 (Build 962 of December 22, 2020):

  • Compiled against PCBUSB v0.10 sources (PCAN-USB Pro FD CAN1)

Version 0.5 SR1 (Build 915 of June 28, 2020):

  • Compiled against PCBUSB v0.9 sources (<MacTypes.h>)

Version 0.5 (Build 850 of December 1, 2019):

  • Reworked command-line option handling:
  • --listen-only - monitor mode (transmitter is off)
  • --list-boards - list all supported CAN interfaces
  • --test boards - list all available CAN interfaces
  • Compiled against PCBUSB v0.8.1 sources

Version 0.4 (Build 698 of September 22, 2017):

  • Support of PCAN-USB FD interface

Version 0.3 (Build 371 of November 23, 2014):

  • Time-stamps are taken from CAN controller

Version 0.2 (Build 138 of May 17, 2013):

  • Initial revision

Version 0.1 (Build 86 of July 6, 2012):

  • reverted

Older versions of the 'can_moni' tool can be downloaded from here or from GitHub.

A Linux version of the 'can_moni' tool using BerliOS SocketCAN can be downloaded from here.



 Other Stuff

Tips and Tricks

Blocking Read

With the PCBUSB library blocking reading of CAN messages can be realized with a file descriptor and the Posix system call select. The file descriptor is – in contrast to the Windows DLL – provided by the driver. An example can be found as a Gist in the MacCAN GitHub repo.

Python Wrapper

To use the PCBUSB library in a cross-platform Python project, the Python wrapper from PEAK´s PCANBasic DLL can be used without further modifications. You just have to import the file from the PCANBasic DLL version 4.5.1 or higher and install the PCBUSB library in the library search path (e.g. in /usr/local/lib).

This and That

Qt Integration

The Qt Serial Bus API is delivered with a plug-in for PCAN interfaces by PEAK-System. Under macOS this plug-in uses the PCBUSB library. You can use it to create beautiful Qt applications that run CAN and CAN FD on a Mac with PCAN-USB interfaces The Qt CAN Bus example runs out-of-the-box, it only requires version 0.8.1 of the PCBUSB library being installed.

Many thanks to Miklós Márton fom Digitroll Kft. AG Electronics who patched the PCAN-Plugin for use with macOS. Great job!


Running CAN and CAN FD on Mac is the mission of the MacCAN project. MacCAN-Core is an abstraction (or rather a wrapper) of Apple´s IOUsbKit to create USB user-space drivers for CAN interfaces from various vendors under macOS.

TouCAN USB Interfaces from Rusoku

Rusoku Technologies is an innovative engineering team based in Lithuania, Europe. They offer CAN adapter at a reasonable price. Drivers and utilities for Windows and Linux are available as open-source. A macOS user-space driver for TouCAN USB interfaces from Rusoku is provided by UV Software. Visit MacCAN-TouCAN to learn more.

CAN Leaf Interfaces from Kvaser

The Swedish company Kvaser AB supplies advanced CAN solutions to engineers designing and deploying systems for manifold areas of applications. They offer a wide range of CAN hardware and CAN software, mainly for applications under Windows but also under Linux. A macOS user-space driver for CAN Leaf Interfaces from Kvaser is provided by UV Software. Visit MacCAN-KvaserCAN to learn more.

MacCAN Monitor App

Play Video

Quick Time Video
Length: 0:00:27 (25MB)
Copyright © 2013 by UV Software, Berlin.




You CAN get it...

Hardware, software and system solutions for many sectors including automotive, aircraft, machinery and equipment building and consumer goods.

Qt Serial Bus API


You CAN use it...

The Qt Serial Bus API supports CAN adapters from PEAK-System, among others. Under macOS it requires the installation of the PCBUSB library.

CAN Interface API, V3


You CAN get more...

CAN API V3 is a wrapper specification to have a uniform CAN Interface API for various CAN interfaces from different vendors running under multiple operating systems.


Donations to my work are gratefully welcome.


© 2012-2021 UV Software, Berlin. All rights reserved. Facebook Twitter My Blog LinkedIn Mail
Privacy Policy Imprint