Main Content

canSignalImport

Import CAN log file into decoded signal timetables

Description

sigtimetable = canSignalImport(file,vendor,database) imports a CAN message log file from the specified vendor directly into decoded signal value timetables using the provided database. The function returns a structure with a field for each unique message in the timetable. Each field value is a timetable of all the signals in all instances of that message. Use this form of syntax to convert an entire set of messages in a single function call.

example

sigtimetable = canSignalImport(file,vendor,database,msgnames) returns signal timetables for only the messages specified by msgnames, which can specify one or more message names. Use this syntax form to import signals from only a subset of messages.

example

Examples

collapse all

Create signal timetables from all messages in a log file.

db = canDatabase('MyDatabase.dbc');
sigtimetable = canSignalImport('MsgLog.asc','Vector',db);

Create signal timetables from specified messages in a log file.

db = canDatabase('MyDatabase.dbc');
sigtimetable1 = canSignalImport('MsgLog.asc','Vector',db,'Message1');
sigtimetable2 = canSignalImport('MsgLog.asc','Vector',db,{'Message1','Message2'});

Input Arguments

collapse all

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

Example: 'MsgLog.asc'

Data Types: char | string

Vendor file format, specified as a character vector or string. The supported file formats are those defined by Vector and Kvaser.

Example: 'Vector'

Data Types: char | string

CAN database, specified as a database handle.

Message names, specified as a character vector, string, or array.

Example: 'message1'

Data Types: char | string | cell

Output Arguments

collapse all

CAN signals, returned as a structure. The structure field names correspond to the messages of the input, and each field value is a timetable of CAN signals.

Data Types: struct

Version History

Introduced in R2017a