rbei-etas / busmaster

BUSMASTER is an Open Source Software tool to simulate, analyze and test data bus systems such as CAN. BUSMASTER was conceptualized, designed and implemented by Robert Bosch Engineering and Business Solutions (RBEI). Presently it is a joint project of RBEI and ETAS GmbH.
http://rbei-etas.github.com/busmaster/
GNU General Public License v3.0
928 stars 494 forks source link

dbf format description? #561

Open ebroecker opened 11 years ago

ebroecker commented 11 years ago

Is there any description of the .dbf-fileformat? Does .dbf support multiple transmitters of the same frame (BO_TXBU in .dbc)?

Background of this question is my attempt to write some universal canmatrix-utility (https://github.com/ebroecker/canmatrix) which supports among other features the conversion between several canmatrix-formats (dbc, dbf, kcd, xls, arxml).

RBEI-Saravanan commented 10 years ago

Multiple transmitters support for the same frame is not available at present.

Following is the DBF file format assuming the version is 1.7.0 and a CAN database file.

//***_BUSMASTER Messages and signals Database *_**//

[DATABASE_VERSION] 1.3

[PROTOCOL] CAN

[BUSMASTER_VERSION] [1.7.0] [NUMBER_OF_MESSAGES] 1

[START_MSG] Message Name, Message ID, Length, Number of Signals, Data Format, Frame Format [START_SIGNALS] Signal Name, length, byte number, start bit number, signal type, Max value, Min Value, Byte order (1-Intel), offset, factor, Unit \ [VALUE_DESCRIPTION] Description Name, Description Value [END_MSG]

ManfredUrban commented 10 years ago

The description is not up to date If you convert a Vector database with multiplexed messages, multiplexers are also to be seen in dbf database in the last position of the definition. This position is missing in the actual description.

etas-lorenz commented 10 years ago

Multiplexed messages are not yet supported. This feature request, also mentioned in issue #587 and issue #676, is still open.

pedro-caetano commented 7 years ago

I found this ticket after searching for some sort of dbf file format standard.

I am not sure if this is public domain or not but going from the source code, I've made a few assumptions/leaps of faith on the dbf database format, hopefully this benefits others who come across this thread in the future :

//***BUSMASTER Messages and signals Database ***//

[DATABASE_VERSION] 1.3

[PROTOCOL] CAN

[BUSMASTER_VERSION] [<version>] //version format: MAJOR.MINOR.PATCH
[NUMBER_OF_MESSAGES] <total_number_of_messages_in_file>

//##############################
[START_MSG]

<msg_name>, //CString
// from source: 'MsgSignal_Datatypes.h'
// CString m_omStrMessageName; // Message Name

<msg_id>, // uint32_t
// from source: 'MsgSignal_Datatypes.h'
// UINT m_unMessageCode; // Message Code

<length>, //uint32_t
// from source: 'MsgSignal_Datatypes.h'
// UINT m_unMessageLength; // Message Length

<number_of_signals>, //uint32_t
// from source: 'MsgSignal_Datatypes.h'
// UINT m_unNumberOfSignals; // Number Of Signals a Message has

<data-format>, // byte or uint32_t? 
// from source: 'MsgSignal_Datatypes.h'
//     int m_nMsgDataFormat; // 1-Intel, 0-Motorola
// from source: 'CommonDefines.h' 
//     enum eEndianess{ eMotorola, eIntel };

<frame-format>,  // char 
// (RTR - Remote Transmission Request, Standard, Extended) ?
// from source: 'MsgInterpretation.cpp'
//    #define defMSGID_RTR            'r'
//    #define defMSGID_STD            's'
//    #define defMSGID_EXTENDED       'x'

//--------------------
[START_SIGNALS]

<signal-name>, // string
// from source: 'MsgSignal_Datatypes.h'
// CString m_omStrSignalName; // Signal Name

<signal-length>, // uint32_t
// from source: 'MsgSignal_Datatypes.h'
// UINT m_unSignalLength; // Signal Length, One indexed

<start-byte-number>, // uint32_t
// from source: 'MsgSignal_Datatypes.h'
// UINT m_unStartByte; // Signal definition start byte in Msg, Zero index

<start-bit-number>, // byte
// from source: 'MsgSignal_Datatypes.h'
// BYTE m_byStartBit;  // Signal start bit, Zero indexed

<signal-type>, // char 
// ('B' = bolean signal; 'U'= unsigned scalar signal; 'I' = signed scalar signal) ?
//
// from source: 'MsgSignal_Datatypes.h'
//    BYTE m_bySignalType; // Signal Type
// from source: 'MsgInterpretation.cpp'
//    #define CHAR_BOOL               'B' 
//    #define CHAR_UINT               'U'
//    #define CHAR_INT                'I'

<Max value>, // uint64_t | int64_t 
// from source: 'MsgSignal_Datatypes.h'
// SIG_VALUE m_SignalMaxValue;

<Min Value>, // uint64_t | int64_t 
// from source: 'MsgSignal_Datatypes.h'
// SIG_VALUE m_SignalMinValue;

<Byte order>, // byte (Motorola = 0  Intel = 1) 
// from source: 'CommonDefines.h' 
// enum eEndianess{ eMotorola, eIntel };

<zero-offset>, // float32_t 
// from source: 'MsgSignal_Datatypes.h'
// float m_fSignalOffset; // Signal Multiplication Factor

<scaling-factor>, // float32_t
// from source: 'MsgSignal_Datatypes.h' 
// float m_fSignalFactor; // Signal Multiplication Factor

<Unit> // string 
// from source: 'MsgSignal_Datatypes.h' 
// CString m_omStrSignalUnit; // Signal Measurement Unit

//--------------------
[VALUE_DESCRIPTION] 

<description-name> ?

<description-value> ?

[END_MSG]

//--------------------
// e.g. from repo: 

// source: Examples/TestAutomation/CAN_Database.dbf
[START_MSG] msg123,123,8,2,1,S
[START_SIGNALS] Voltage,8,1,0,U,50,0,1,0.000000,0.250000,V,
[START_SIGNALS] RPM,16,2,0,U,10000,0,1,0.000000,0.500000,1/s,
[END_MSG]

// source: Tests/AutoIt/Module_AutomationV2/TestData/SimCAN.dbf
[START_MSG] msg1,81,5,2,1,S
[START_SIGNALS] SIG1,5,1,0,I,15,-16,1,0.000000,1.000000,,
[START_SIGNALS] SIG2,5,2,0,I,15,-16,1,0.000000,1.000000,,
[END_MSG]

// source: Tests/AutoIt/Module_AutomationV2/TestData/SimCAN.dbf
[START_MSG] msg2,85,5,2,1,S
[START_SIGNALS] SIG3,5,1,0,I,15,-16,1,0.000000,1.000000,,
[START_SIGNALS] SIG4,5,2,0,I,15,-16,1,0.000000,1.000000,,
[END_MSG]

//##############################

@RBEI-Saravanan I appreciate this is time consuming but if possible could you confirm that these assumptions are correct?

Also would this be something we can contribute to in the projects documentation or is *.dbf format spec proprietary and not meant to be public domain?

*edit: markdown formatting