CANopenNode/CANopenNode logo

CANopenNode/CANopenNode

Free

CANopen protocol stack

FreeFree tier
Type
Open Source

About CANopenNode/CANopenNode

CANopenNode is a free and open source CANopen protocol stack written in ANSI C with an object-oriented design. It implements the internationally standardized CANopen higher-layer protocol (EN 50325-4, CiA301) for embedded control systems built on top of CAN. The stack runs on various microcontrollers, either as a standalone application or with a real-time operating system (RTOS). It features a complete CANopen Object Dictionary that organizes communication, device, and custom variables, accessible both from C code and over the CANopen network. Key capabilities include NMT slave and simple master, Heartbeat and Node Guarding error control, PDO with dynamic mapping and bitwise mapping, SDO server/client (expedited, segmented, block transfer), Emergency message producer/consumer, Sync producer/consumer for network-synchronized PDO transmission, Time-stamp producer/consumer with millisecond resolution, LSS for node-ID and bitrate setup (master/slave, fastscan), a CANopen gateway with CiA309-3 ASCII command interface, and CANopen Safety (EN 50325-5, CiA304). The stack is suitable for 16-bit microcontrollers and above, is multithreaded and real-time, includes a non-volatile storage option for Object Dictionary variables, supports power saving and bootloader for firmware updates, and has passed the CANopen Conformance Test Tool. It contains no device-specific drivers; those must be added separately for each target system, with an example provided that compiles on any system but does not connect to actual CAN hardware.

Key Features

CANopen Object Dictionary for organized variables, accessible via C code and CANopen network
NMT slave and simple NMT master for device start/stop/reset
Heartbeat producer/consumer and Node Guarding for error control
PDO for high-priority broadcast of process data with dynamic and bitwise mapping
SDO server and client with expedited, segmented, and block transfer
Emergency message producer and consumer
Sync producer/consumer for network-synchronized PDO transmission
Time-stamp producer/consumer with millisecond date and time synchronization
LSS master and slave with LSS fastscan for node-ID and bitrate setup
CANopen gateway with CiA309-3 ASCII command interface for NMT, LSS, and SDO

Pros & Cons

Pros
  • Free and open source (ANSI C, object-oriented)
  • Runs on a wide range of microcontrollers, standalone or with RTOS
  • Comprehensive protocol support: NMT, PDO, SDO, Emergency, Sync, Time-stamp, LSS, Safety, gateway
  • Passed CANopen Conformance Test Tool for standards compliance
  • Includes related projects (CANopenDemo) for tutorials and testing
  • Active community with 2k stars and 800 forks on GitHub
Cons
  • Does not include device-specific drivers; must be added separately for each target system
  • Base example compiles on any system but does not connect to actual CAN hardware
  • Requires knowledge of CANopen protocol and C programming for integration
  • Documentation primarily via Doxygen and GitHub wiki, may lack beginner-friendly tutorials

Best For

Embedded control systems in industrial automationCAN-based networked embedded devices (e.g., sensors, actuators, controllers)Real-time control applications with deterministic communicationSafety-critical systems requiring CANopen Safety protocolMulti-microcontroller systems with synchronized process data exchangeFirmware update and bootloader implementation in CANopen devices