Skip to content

CAN Database

A CAN database stores configurations for CAN messages/signals and enums that are used by devices to properly structure the CAN data they send out. One database can contain as many CAN messages as needed, each of which can contain as many signals as will fit in the message.

Access CAN Databases

  1. Go to the model editor for the desired model via the Models page.
  2. Click on the CAN Databases section in the section selector.
  3. Click on the Messages button to view the CAN messages for a CAN database.
  4. Click on the Enums button to view the CAN enums for a CAN database.

Messages

CAN messages have two main parts: the ID and the payload. The ID must be unique compared to all other messages in the database so that any device using the database knows which message it’s sending/receiving.

  • Click on the in the sidebar to create a new message.
  • To delete a message, select it in the sidebar and click the Delete button in the settings form.

Configuration

  • Name
    • Enter the name of the message.
  • CAN ID
    • Specify the unique CAN ID used by the device to recognize data in this message.
  • Type
    • Specify the type of message.
    • This affects the length of the CAN ID.
  • Direction
    • Specify the direction of data flow.
  • Data Length
    • Enter the length (in bytes) of the message.
    • The length must be at minimum long enough to contain all the signals.
  • Send Period
    • Specify the time (in seconds) after which the data needs to be sent or received.
  • Multipacket
    • Toggle whether to allow the sending of data as multiple packets.
  • Logged on device
    • Toggle whether the device should include this message in log data files.
  • Send over MQTT
    • Toggle whether to send/receive the data values over MQTT.
  • Retain
    • Toggle whether the device should retain this message locally.
  • Comment
    • Add comments for reference and documentation purposes.

Signals

A CAN message can have multiple signals based on the data length defined for the message.

  • Click the button to create a new signal.
  • Click on the button beside a signal to edit its configuration.
  • Click on the button beside a signal to delete it.

Layout

Click the button to view a visual representation of the message’s bit layout with all its signals. Each signal is displayed in a different color, with its length corresponding to its configured length (in bits).

The first signal will start at (Byte, Bit) pair (0, 0) and go from right to left.

J1939 Protocol

Current Platform Support

Single-Packet Support
  • The platform can decode J1939 single-packet messages.
Multi-Packet Support
  • The platform correctly handles J1939 multi-packet messages using the transport protocol (RTS/CTS).
  • Pending - Connection management packet parsing and get the CAN ID and data length from RTS packet.

Enums

CAN enums define a set of named values that can be assigned to signals. Each enum consists of a list of value pairs (name and numeric value), and can be reused across multiple signals in the database.

  • Click on the in the sidebar to create a new enum.
  • To delete an enum, select it in the sidebar and click the Delete button in the settings form.

Configuration

  • Name
    • Enter the name of the enum.
  • Comment
    • Add comments for reference and documentation purposes.

Values

An enum contains multiple named values, each with an associated numeric value.

  • Click the button to create a new value.
  • Click on the button beside a value to edit its configuration.
  • Click on the button beside a value to delete it.

Value Configuration

  • Name
    • Enter the name of the value. Must be unique within the enum.
  • Value
    • Enter the numeric value (0 or higher). Must be unique within the enum.
  • Comment
    • Add comments for reference and documentation purposes.

Used Signals

This section displays all signals in the CAN database that use this enum as their data type. Each entry shows the signal name and the message it belongs to.