can.Database Properties
Properties of the can.Database
object
Use the following properties to examine or configure CAN database settings. Use
canDatabase
to create a CAN database object.
can.Database
Name
— CAN database name
char
This property is read-only.
The Name
property displays the name of the database, as a
character vector value. This value is acquired from the database file name.
Data Types: char
Path
— Path to CAN database file
char
This property is read-only.
The Path
property displays the path of the database including
the DBC file, as a character vector.
Data Types: char
Nodes
— Node names from CAN database
cell
This property is read-only.
The Nodes
property stores the names of all nodes defined in the
specified CAN database, as a cell array of character vectors. For example, to examine
and index into the database nodes:
db = canDatabase('CANex.dbc');
db.Nodes
3×1 cell array {'AerodynamicControl' } {'Aftertreatment_1_GasIntake'} {'Aftertreatment_1_GasOutlet'}
db.Nodes{1}
'AerodynamicControl'
Data Types: cell
NodeInfo
— Information on CAN database nodes
struct
This property is read-only.
The NodeInfo
property is a structure with information about all
nodes defined in the specified CAN database. The NodeInfo
property
is a read-only structure. Use indexing to access the information of each node. For
example:
db = canDatabase('CANex.dbc');
db.NodeInfo
3×1 struct array with fields: Name Comment Attributes AttributeInfo
db.NodeInfo(1).Name
'AerodynamicControl'
Data Types: struct
Messages
— Message names from CAN database
cell
This property is read-only.
The Messages
property stores the names of all messages defined
in the specified CAN database, as a cell array of character vectors.
db = canDatabase('CANex.dbc');
db.Messages
3×1 cell array {'A1' } {'A1DEFI' } {'A1DEFSI'}
db.Messages{1}
'A1'
Data Types: cell
MessageInfo
— Information on CAN database messages
struct
This property is read-only.
The MessageInfo
property is a structure with information about
all messages defined in the specified CAN database.
Use indexing to access the information of each message. For example:
db = canDatabase('CANFDex.dbc');
db.MessageInfo
3×1 struct array with fields: Name: 'CANFDMessage' ProtocolMode: 'CAN FD' Comment: '' ID: 1 Extended: 0 J1939: [] Length: 48 DLC: 14 BRS: 1 Signals: {2×1 cell} SignalInfo: [2×1 struct] TxNodes: {0×1 cell} Attributes: {2×1 cell} AttributeInfo: [2×1 struct]
db.MessageInfo(1).Name
'CANFDMessage'
Data Types: struct
Attributes
— Attribute names from CAN database
cell
This property is read-only.
The Attributes
property stores the names of all attributes
defined in the specified CAN database, as a cell array of character vectors.
Use indexing to access the information of each attribute. For example:
db = canDatabase('CANex.dbc');
db.Attributes
3×1 cell array {'BusType' } {'DatabaseVersion'} {'ProtocolType' }
db.Attributes{1}
'BusType'
Data Types: cell
AttributeInfo
— Information on CAN database attributes
struct
This property is read-only.
The Attributeinfo
property is a structure with information
about all attributes defined in the specified CAN database.
Use indexing to access the information of each attribute.
db = canDatabase('CANex.dbc');
db.AttributeInfo
3×1 struct array with fields: Name ObjectType DataType DefaultValue Value
db.AttributeInfo(1).Name
'BusType'
Data Types: struct
UserData
— Custom data
any data
Enter custom data to be stored in your CAN message or a J1939 parameter group,
channel, or database object using the UserData
property. When you
save an object with UserData
specified, you automatically save the
custom data. When you load an object with UserData
specified, you
automatically load the custom data.
Tip
To avoid unexpected results when you save and load an object with
UserData
, specify your custom data in simple data types and
constructs.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| char
| string
| struct
| table
| cell
| function_handle
| categorical
| datetime
| duration
| calendarDuration
| fi
Complex Number Support: Yes
Version History
Introduced in R2009a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)