Main Content


Import CAN messages from third-party log file



message = canMessageImport(file,vendor) imports CAN messages from the log file, file, from a third-party vendor, vendor. All the messages in the log file are imported as an array of CAN message objects.

After importing, you can analyze, transmit, or replay these messages.

canMessageImport assumes that the information in the imported log file is in a hexadecimal format, and that the timestamps in the imported log file are absolute values.


message = canMessageImport(file,vendor,candb) applies the information in the specified database to the imported CAN log messages.

To import Vector log files with symbolic message names, specify an appropriate database file.

message = canMessageImport(___,'OutputFormat','timetable') returns a timetable of messages. This is the recommended output format for optimal performance and representation of CAN messages within MATLAB®.


collapse all

Import raw messages from a log file.

message = canMessageImport('MsgLog.asc','Vector','OutputFormat','timetable');

Import messages from a log file, using database information for physical messages.

candb = canDatabase('myDatabase.dbc');
message = canMessageImport('MsgLog.txt','Kvaser',candb,'OutputFormat','timetable');

Input Arguments

collapse all

Name of CAN message log file, specified as a character vector or string.

Example: 'MsgLog.asc'

Data Types: char | string

Name of vendor, specified as a character vector or string, whose CAN message log file you are importing from.

You can import message logs only in certain file formats: ASCII files from Vector, and text files from Kvaser.

Example: 'Vector'

Data Types: char | string

CAN database, specified as a database object. This is the database whose information is applied to the imported log file messages.

Example: candb = canDatabase('CANdb.dbc')

Output Arguments

collapse all

Imported messages, returned as an array of CAN message objects or as a timetable of messages.

Version History

Introduced in R2010b

See Also