Main Content

blfread

Read data from Vector BLF-file

Description

example

mdata = blfread(blfFile) reads all the data from the specified BLF-file and returns a cell array of timetables to the variable bdata. The index of each element in the cell array corresponds to the channel number of the data in the file.

bdata = blfread(blfFile,chanID) reads message data for the specified channel from the BLF-file and returns a timetable.

bdata = blfread(___,Name,Value) reads message data filtered by parameter options for CAN database and message IDs.

Note

Support for BLF-files is limited to only CAN and CAN FD protocols on Windows® operating systems. See File Format Limitations.

Examples

collapse all

Read message data from a BLF-file, applying optional filters.

data = blfread("myfile.blf",2)
candb = canDatabase("testdb.dbc");

data = blfread("myfile.blf", "Database", candb)
data = blfread("myfile.blf", "Database", candb, "CANStandardFilter", 1:10)
data = blfread("myfile.blf", "Database", candb, "CANExtendedFilter", 3:7)
data = blfread("myfile.blf", "Database", candb, "CANStandardFilter", 1:10, ...
                                                "CANExtendedFilter", 3:7)
data = blfread("myfile.blf", "CANStandardFilter", 1:10, "CANExtendedFilter", 3:7)

Input Arguments

collapse all

Path to BLF-file, specified as a string or character vector. The value can specify a file in the current folder, or a relative or full path name.

Example: "MultipleChannelFile.blf"

Data Types: string | char

Channel ID, specified as a numeric scalar value, for which to read data from the BLF-file. If not specified, all channels are read.

Example: 2

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: "CANStandardFilter",1:8

CAN database to use for message decoding, specified as a can.Database object.

Example: candb()

Message standard IDs, specified as an array of numeric values identifying which messages to import. Message IDs are general, and apply to both CAN and CAN FD bus types. The value can specify a scalar or an array of either a range or noncontiguous IDs. By default, all standard ID messages are imported.

Example: [1:10 45 100:123]

Data Types: string | char

Message extended IDs, specified as an array of numeric values identifying which messages to import. Message IDs are general, and apply to both CAN and CAN FD bus types. The value can specify a scalar or an array of either a range or noncontiguous IDs. By default, all extended ID messages are imported.

Example: [1 8:10 1001:1080]

Data Types: string | char

Output Arguments

collapse all

Message data from BLF-file, returned as a cell array of timetables. If you specify a single channel to read, this returns a timetable.

Version History

Introduced in R2019a