我們測試的時候都是直接拿到別人給的DBC就使用了, 但是如果沒有數據庫文件,怎樣創建一個DBC呢?
方法1.XLS2DBC
通常情況下,我們可以拿到通信矩陣。這時可以先整理好通信矩陣的表格格式,再通過網上提供的一些工具直接轉換成DBC,此處不多講。如果自己具備編碼能力,也可以自己去寫轉換工具實現這個功能。
方法2. 通過CANoe的小工具CANdb++新建DBC
CANdb++在CANoe中的位置
它也支持單獨打開,安裝目錄下\Vector CANoe 10.0\Exec32\CANdb.exe
-----------------------分割線-------------------------
在開始講解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.對象命名規則
注意:此處的對象在第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. |
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