canDatabase

Create handle to CAN database file

Description

example

candb = canDatabase('dbfile.dbc') creates a handle to the specified database file dbfile.dbc. You can specify a file name, a full path, or a relative path. MATLAB® looks for dbfile.dbc on the MATLAB path. Vehicle Network Toolbox™ supports Vector CAN database (.dbc) files.

Examples

collapse all

Create objects for example database files.

candb = canDatabase([(matlabroot) '\examples\vnt\demoVNT_CANdbFiles.dbc'])
candb = 

  Database with properties:

             Name: 'demoVNT_CANdbFiles'
             Path: 'F:\matlab\examples\vnt\demoVNT_CANdbFiles.dbc'
            Nodes: {}
         NodeInfo: [0×0 struct]
         Messages: {5×1 cell}
      MessageInfo: [5×1 struct]
       Attributes: {}
    AttributeInfo: [0×0 struct]
         UserData: []
candb = canDatabase([(matlabroot) '\examples\vnt\J1939.dbc'])
candb = 

  Database with properties:

             Name: 'J1939'
             Path: 'F:\matlab\examples\vnt\J1939.dbc'
            Nodes: {2×1 cell}
         NodeInfo: [2×1 struct]
         Messages: {2×1 cell}
      MessageInfo: [2×1 struct]
       Attributes: {3×1 cell}
    AttributeInfo: [3×1 struct]
         UserData: []

Input Arguments

collapse all

Database file name, specified as a character vector or string.. You can specify just the name or the full path of the database file.

Example: 'J1939.dbc'

Data Types: char | string

Output Arguments

collapse all

CAN database, returned as a database object with can.Database Properties.

See Also

Functions

Properties

Introduced in R2009a