Import DBC File

<< Click to Display Table of Contents >>

Navigation:  CAN >

Import DBC File

YouTube_icon Tutorial video of the DBC import

 

 

Please note that this feature has to be bought first. Contact your vendor to obtain a license. Without a license, it is not possible to import the content of a DBC file.

 

Disclaimer!

Please always validate your DBC file in Vector before importing it. This will ensure that the import works and the functionality is as expected.

 

If you have problems importing a DBC file and you don't think it's a problem in the file, please send the file to your vendor for analysis.

 

clip0052

 

To start the import, open the dialog under the menu Communication -> Import-Export -> Import DBC File.

Note that the dialog can only be opened with an opened project.

 
The import process is done in two steps.

 

In the first step, a CAN protocol needs to be chosen and a DBC file is selected.

In the second step, the CAN messages and variables to be imported are selected.

 

1. Select File for Import

 

clip0030

 

If no CAN protocol has been added to the project, an import of a DBC file isn't possible, so first at least one CAN protocol has to be added.

The Configure ECU(s) dialog can be reached directly from this dialog with the button "Configure ECU(s)...".

If there are several protocols in the project, one has to be chosen for the DBC import, i.e. in which protocol should the CAN mappings be added.

 

When a protocol has been added and / or chosen, a DBC file can be loaded.

 

The program will check the integrity of the DBC file. If there is a problem parsing the file, an error message will be shown, indicating the problem with the file.

 

clip0059

 

In this case the parsing failed with an error in the Message_3 of Signal_9. The hint [NumberFormatExceoption] shows the root cause for this issue. In the example the Factor 1g could not be parsed.

 

clip0060

 

In this case the parsing failed with an error in the Message_3. The hint [ParameterExceoption] shows the root cause for this issue. In the example a parameter Message-Length is missing.

 

NOTE: Please validate the DBC-File with Help of Vector CANdb++ Editor and solve all warnings before importing the DBC-File.

 

 

When the DBC file is loaded successfully, at first the ECU(s) used in the DBC file can be mapped to (an) existing ECU(s).

 

clip0024

 

If no ECU is chosen (<no assignment>), the ECU will be created for the selected protocol. If an ECU with the same name already exists, the ECU name is marked in red. Then the ECU needs to be mapped to an existing ECU, since there can't be two ECU's with the same name.

 

clip0061

 

 

For the CAN-Protocol CANopen the COB-ID oft the ECU must be unique. In case that the COB-ID already exists the ECU can not be imported.

To solve the error either the COB-ID in the DBC-File must be updated or the COB-ID of the already existing ECU must be updated.

 

clip0062

 

Below the ECU selection box there are two check boxes.

 

clip0100

 

With the fist check box, all ECUs can be selected / deselected for import.

With the second check box, the terminal ECU settings (the CAN protocol settings for the OPUS device) can be imported from a DBC file.

Note: The check box is only available if such settings have been exported into the DBC file. Only DBC files from version 2020.4 onwards can have these settings included.

Note: The check box is only available for J1939 and CANopen  imports, as CANFreestyle doesn't have any necessary Terminal ECU settings.

Note: The check box is only available if the selected protocol and the Terminal ECU settings in the DBC files are from the same protocol.

 

If no ECU is specified in the DBC file, no further settings can be made

 

Once all settings have been made, click Next to continue.

The import process can be canceled at any time by clicking Cancel.

 

2. Select CAN Messages and Variables

clip0055

 

In the second step of the dialog the CAN messages and variables for import can be selected. To select a CAN message for import, activate the check box in the Select column in the upper table of the dialog. With Select/deselect all CAN Messages, all messages can be selected or deselected at once.

 

If a CAN message in the DBC file is not compatible with the selected CAN protocol (e.g. a J1939 message with > 8 bytes is defined in the DBC file, but the CAN Freestyle protocol has been selected to be used), the CAN message will be displayed with a red error icon and cannot be selected.

 

clip0063

 

The direction type (Receive or Transmit) can be set in the column Type. The name of the CAN mapping can also be changed from what is given in the DBC file. Finally, the owner can be changed in the column Owner to specify from which ECU the message will be sent.

 

When a CAN message is selected for import, the according variables are automatically selected for import, as well.

The table below the CAN messages shows the mapped variables of the currently selected CAN message.

The variable name, index, sub index and owner can be changed in this table. When the name, index and sub index is changed, it is checked if there is a conflict with existing variables. If there is, the according variable will be marked in red and an import is not possible.

 

clip0056

 

Only when there are no conflicts, the import process can be finished.

 

If a variable is already existent in the project and the data type matches the variable in the DBC file, the variable will be used. In the Mapped Variable table, such variables will be shown with a gray background. No properties of such variables can be changed (since the variable is already created in the project).

 

clip0057

 

In the bottom of the dialog an overview of the CAN messages and variables in the DBC file and the ones selected for import are shown.

 

In the Variables tab all variables in the DBC file are shown. In this tab, variables can be selected and deselected for import.

 

Please note: If a variable is deselected in this tab, this will lead to the deselection of all CAN messages where this variable is mapped.

Variables can be imported without the CAN messages, but CAN messages can not be imported without the according variables.

 

In the upper part of the dialog the search field can be used to filter the currently displayed variables / CAN messages.

Below the search field the current view can be filtered for

 

- only elements selected for import

- elements that have conflicts left to be resolved.

- elements with errors that can not be resolved

 

Additionally, regular expressions can be used to search in the DBC file data.

 

clip0058

 

The search can also be used to specifically search in certain data fields:

 

CAN Messages tab:

Column Import [boolean] => #Import=false/true => true if Object is selected for import

Column Name [String] => #Name=<MappingName> => NOTE: Variable Mappings Name will also be considered!

Column Type [String] => #Type=Receive/Transmit

Column Length [Integer] => #Length=8 #Length<=4

Column Owner [String] => #Owner=<OwnerName>

 
Other searchable properties are:

Description [Sring] => #Description=<Text>

CanImport [boolean] => #CanImport=false/true => false shows all Mappings which can not be imported!

  Mappings conflicts which can not be solved by user! E.g. Messages with Length > 8 Byte for CANFreestyle

COB-ID (CANopen) [int] => #COB-ID=0x111

PGN (J1939) [int] => #PGN=0x1200

CAN-ID (CANFreestyle,) => #CAN-ID=0x16

 

Note: The term CAN-ID is used for all protocols, i.e. for CANopen it searches COB-IDs and for J1939 PGNs.

 

Variables tab:

Column Import [boolean] => #Import=false/true => true if Object is selected for import

Column GroupName [String] => #GroupName=<GroupName>

Column Name [String] => #Name=<VariableName>

Column Length [Integer] => #Length=8 or #Length<=4

Column Index [Integer] => #Index=0x3000

Column SubIndex [Integer] => #SubIndex=0x01

Column Owner [String] => #Owner=<OwnerName>

Column CANMessage [String] => #CANMessages=<MessageName> #Messages=<MessageName>
Other searchable Properties are:

Description [Sring] => #Description=<Text>

CanImport [boolean] => #CanImport=false/true => false shows all Variables which can not be imported! e.g. Length of Variable is >32bit

 

Examples:

 

#CAN-ID=0x7e5 searches for all mappings with ID 0x7e5

#Name=engine searches for all mappings that contain the character sequence "engine" anywhere in the mapping name or variable name

 

Note: Search terms can be combined (AND) by typing them one after another:

 

#CAN-ID=0x7e5 #Name=engine searches for all mappings with ID 0x7e5 that have engine in the mapping name or variable name

 

Note: Invalid search terms will be ignored, e.g. the upper search term combination in the Variables tab will ignore the #CAN-ID search term.

Note: The search terms are case-sensitive.

 

Additional information

 

The "producer" property of a message will be set as the "Receive From" value in a Receive mapping

The "consumer" property of a message will be set as the "Transmit To" value in a Transmit mapping

Scale and Offset of CAN messages will be imported as scale and offset 2 properties for CAN mappings. Offset1 is only populated if the DBC file was created by the program in version 2020.4 or higher

 

 

Finish

 

Only when there are no conflicts, the import process can be finished by clicking Finish.

Then a dialog will be shown with an overview of what has been imported.

 

clip0028

 

The import process can be canceled at any time by clicking Cancel.