In CAN DBC, object attributes are additional information that can be associated with objects such as nodes, messages, and signals. These attributes can be used to store information about the object, such as its Message Transmit type, Message cycle time, or Initial value of a signal.

There are two types of attributes in CAN DBC, System Parameters and User defined attributes.

System Parameters

These are parameters that are absolutely necessary to define an object in a CAN DBC. These are the parameters that you see and configure while creating a Node, message or a signal.

User defined attributes

These are parameters which are defined by the user. Since these are can have any user specific meaning, for other vector tools to interpret these correctly, we need to do a mapping. While exchanging (importing) data, mapping assigns the contents of user-defined attributes to predefined fields (attributes) of the relevant program(s) of the Vector CAN tools tool chain.

What are the properties of User-defined attributes?

Each user-defined attribute contains the below parameters.

  1. Object Type: This defines the type of the object for which this attribute is defined eg: Node, Message or a Signal.
  2. Minimum, Maximum: For attributes of data type Int, float and Hex, this parameter defines the minimum and maximum value that the attribute can take.
  3. Default Value: This parameter defines the default value to be assigned to the attribute when there’s no value.
  4. Column: This defines the name of the column to be displayed in lists/overview window for this attribute.
  5. Value Type: This defines the data type of the attribute. One of the following data type can be used.
Value TypeDescription
Integer32 bit signed integer
Float 64 bit double precision float
StringASCII string
EnumerationThis is an enum. Valid values are defined in the value range.
Each line in the Value Range defines a valid enum value.
Hex32 bit Unsigned Integer.
This is always displayed in Hex format.

How to define user defined attributes?

There are three methods to define user-defined attributes in a DBC. Lets explore them one by one.

1. Manual definition of User-defined attributes

For manually adding User defined attributes, go to View and select Attribute Definitions

Open Attribute definitions window
Open Attribute definitions window

This will open the attributes window, where you can see some pre-defined attributes.

To add your new attribute, right click anywhere on the window and select “New”

Add a new Attribute
Add a new Attribute

This will open an attribute definition dialogue, where we can configure our new attribute.

New attribute definition
New attribute definition

Similarly you can add any number of attributes.

2. Importing attribute definitions from another DBC

The second way is to import attribute definitions from another dbc, which has the necessary attributes already defined in it. For this, go to file and select “Import Attribute Definitions”

Import Attribute definitions from an existing dbc

The tool will check for the existing definitions and import it to your new dbc. After the import is complete, you can see a log of import. Then you can go to “View” -> “Attribute Definitions” and see all the imported attributes.

3. Adding attributes from a Script

This is the easiest way to define attributes. Vector provides a set of scripts, which can be used to define attributes in the dbc file you are working on. For this,

a. Go to “File” menu and select “Execute Script…”, this will open a file selector dialogue box.

b. All the scripts provided by Vector are stored at “C:\Program Files (x86)\Vector CANdb++ 3.1\Scripts\”.

c. You can choose one of the scripts and run it as shown, this will add the attributes to your dbc file.

Now, there are multiple scripts and if you wanna know the use case of each one of them, leave me a comment below and I will cover them.

How to use User-defined attributes?

Once you have defined the attributes, we can use them by going to “Attributes” tab of the object that you want to configure. For example, if you want to change the cycle time of a message, open the message and go to “Attributes” tab and change the value as shown

Configure the attributes

That’s all about attribute definitions and their usage in CAN DBC. See you!

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!