CANpie FD
CAN programming interface environment - Version 3.08
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Modules Pages
CANpie FD API

CAN is based on a broadcast communication mechanism. This broadcast communication is achieved by using a message oriented transmission protocol. These messages are identified by using a message identifier. The message identifier has to be unique within the whole network and it defines not only the content but also the priority of the message.

The CAN data link layer comprises two protocols: Classical CAN introduced in 1986 and CAN FD introduced in 2012. The protocols are internationally standardized in ISO 11898-1:2015. Both protocols support base frames (11-bit CAN-ID) and extended frames (29-bit CAN-ID), leading to four message frame formats:

  • Classical base frame format (CBFF): message that contains up to 8 byte and is identified by 11 bits
  • Classical extended frame format (CEFF): message that contains up to 8 byte and is identified by 29 bits
  • FD base frame format (FBFF): message that contains up to 64 byte and is identified by 11 bits
  • FD extended frame format (FEFF): message that contains up to 64 byte and is identified by 29 bits

The Classical CAN protocol uses one bit-rate in the arbitration and the data phase. The transmission speed is limited to 1 Mbit/s. The payload (i.e. the data field) is limited to 8 byte. The following picture shows a Classic CAN frame with an 11-bit CAN-ID.

Classic CAN frame


The CAN FD protocol allows payloads up to 64 byte. Additionally, it supports an optional second bit-rate for the data-phase (field BRS). The following picture shows a CAN FD frame with an 11-bit CAN-ID.

CAN FD frame

Programming in C

canpie.h

CANpie FD definitions

cp_core.h

CANpie FD core functions

cp_fifo.h

CANpie FD FIFO functions

cp_msg.h

CANpie FD message access functions

Programming in C++

The CANpie FD API provides classes for manipulation of CAN frames and passing these frames via a socket interface (QCanSocket) between applications.

The classes are using the Qt Library and have the prefix QCan. The following table gives an overview.

QCanFrame

Class defining a CAN data frame or error frame

QCanInterface

Class defining a physical CAN interface

QCanNetwork

Class defining a CAN network

QCanNetworkSettings

Access parameters of QCanNetwork

QCanPlugin

Class for a CAN plugin, used by the QCanServer

QCanServer

CANpie server class, managing multiple CAN networks

QCanServerSettings

Access parameters of QCanServer

QCanSocket

Class defining a CAN socket, which connects to a QCanNetwork

QCanSocketCpFD

CANpie FD interface for QCanSocket class

QCanSocketDialog

Dialog for QCanSocket class

QCanTimeStamp

Time-stamp with a resolution of 1 nanosecond.