如何經過CANdb++建立一個新的DBC(一)

咱們測試的時候都是直接拿到別人給的DBC就使用了, 可是若是沒有數據庫文件,怎樣建立一個DBC呢?node

方法1.XLS2DBC數據庫

一般狀況下,咱們能夠拿到通訊矩陣。這時能夠先整理好通訊矩陣的表格格式,再經過網上提供的一些工具直接轉換成DBC,此處很少講。若是本身具有編碼能力,也能夠本身去寫轉換工具實現這個功能。app

方法2. 經過CANoe的小工具CANdb++新建DBC

CANdb++在CANoe中的位置

它也支持單獨打開,安裝目錄下\Vector CANoe 10.0\Exec32\CANdb.exedom

 

-----------------------分割線-------------------------工具

在開始講解DBC的建立以前,先說一下基本知識點測試

1. Intel 和 Motorola格式

在CAN數據庫中的信號能夠定義爲intel或motorola處理器的字節序,它用來區分消息中信號的字節排序狀況。this

Byte order for Motorola processors (Big Endian)編碼

Byte order for Intel processors (Little Endian)spa

Bit significance (Bit Order)3d

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.對象命名規則

注意:此處的對象在第3點會描述這些對象的屬性

(1) 如下對象的命名需遵循C語言標識符的命名規則

必須字母或下劃線開頭,以後能夠包含字母/字符/下劃線等.

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

(2) 如下對象的命名不受約束

  • 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

 -----------------------分割線-------------------------

未完待續,下篇繼續多圖展現一步步建立DBC

相關文章
相關標籤/搜索