使用CANdb++创建.dbc文件(1)

如何创建一个dbc文件呢?

1. 工具快速生成

编辑通信矩阵表,利用工具转换生成。无生产工具,那就按方法2逐条创建吧。

 2. CANdb++逐条新建

 

在介绍如何新建.dbc文件之前,先分享一些相关的知识点(保留英文原文帮助理解)。

1)Intel 和 Motorola格式

在CAN数据库中的信号可以定义为intel或motorola处理器的字节序,它用来区分消息中信号的字节排序情况。

Byte order for Motorola processors (Big Endian)

Byte order for Intel processors (Little Endian)

Bit significance (Bit Order)

Within a byte the significance of bits is the same in both formats

msb: most significant bit; lsb: least significant bit

Bit Indication

The bits of a message have following indices:

(1) Bit indexing in the byte from the right to the left

Transmitting a message with 8 byte length on the bus, bit 7 (most significant bit of byte 0) will be transmitted first, followed by bit 6. Bit 56 (least significant bit of byte 7) will be transmitted at last.

(2) Bit indexing in the byte from the left to the right – inverted or sequential bit indexing

Transmitting a message with 8 byte length on the bus, bit 0 (most significant bit of byte 0) will be transmitted first, followed by bit 1. Bit 63 (least significant bit of byte 7) will be transmitted at last.

2)对象命名规则

(a) 以下对象的命名需遵循C语言标识符的命名规则

必须字母或下划线开头,之后可以包含字母/字符/下划线等.

  • Signals, multiplexor signals, multiplexed signals
  • Signal groups, multiplexor signal groups, multiplexed signal groups
  • Messages
  • Nodes/network nodes
  • Value tables
  • Environment variables

(b) 以下对象的命名不受约束

  • Controllers/ECUs
  • Vehicles
  • Networks
  • Node groups
  • Attributes
  • Value descriptions within value tables*
3)Vector工具链属性

总体分为以下5类,分别是DBC数据库中的各个对象下的一些属性,这些属性的定义了它们能用在Vector的哪些工具链中。

  • General

  general attributes, which cannot be ordered to any application domain.

  • Interaction Layer

  attributes describing the transmit and receive behavior of messages and signals.

  此处简单描述几个属于此分类下的属性:

GenMsgCycleTime

Object Type:

Message

Value Type:

Int

Unit:

[ms]

Default Value:

0

Valid Values:

>= 0

Description:

Defines the fixed periodicity for cyclic message transmissions.

 

GenSigStartValue

Object Type:

Signal

Value Type:

Int

Unit:

 

Default Value:

0

Valid Values:

 

Description:

Defines the start or initial value of the signal.
This value is send after system start-up until the application sets the signal value the first time.
The signals start value is given as a signals raw value in this attribute.
  • Transport Protocol and Diagnostics

  attributes for the configuration and the behavior of the ISO/DIS transport protocol for CAN and the diagnostics of ECUs.

  • Network Management

  attributes for the configuration and the behavior of the OSEK network management of a CAN network.

  • Tool specific

  attributes used for the configuration of Vector tools

 -----------------------分割线-------------------------

未完待续,下篇图示step by step创建dbc

 

 
posted @ 2019-10-10 17:16  水一年  阅读(9958)  评论(0)    收藏  举报