blfwrite
Write data to Vector BLF file
Description
Examples
Write Data to a BLF File
Write timetables of CAN messages to specified channels in a BLF file.
Create message timetables. In this case, the messages were already read from an MDF file.
canmsgtable = canMessageTimetable(mdfData{3},db)
canmsgtable = 10×8 timetable Time ID Extended Name Data Length Signals Error Remote _______ __ ________ ________ _________________________________ ______ ____________ _____ ______ 0.1 sec 1 false {'Msg1'} {[ 41 107 214 235 44 169 3 33]} 8 {1×1 struct} false false 0.2 sec 2 false {'Msg2'} {[ 187 239 95 95 76 252 16 236]} 8 {1×1 struct} false false 0.3 sec 3 false {'Msg3'} {[ 190 212 237 81 6 69 77 153]} 8 {1×1 struct} false false 0.4 sec 4 true {'Msg4'} {[ 37 142 81 101 83 5 92 51]} 8 {1×1 struct} false false 0.5 sec 5 true {'Msg5'} {[ 236 63 84 22 167 34 205 204]} 8 {1×1 struct} false false 0.6 sec 6 true {'Msg6'} {[ 143 96 212 243 78 74 96 61]} 8 {1×1 struct} false false 1.1 sec 1 false {'Msg1'} {[203 238 47 104 22 117 147 109]} 8 {1×1 struct} false false 1.2 sec 2 false {'Msg2'} {[ 53 51 244 13 76 230 5 57]} 8 {1×1 struct} false false 1.3 sec 3 false {'Msg3'} {[ 33 16 115 17 139 208 161 90]} 8 {1×1 struct} false false 1.4 sec 4 true {'Msg4'} {[ 80 99 145 50 216 246 168 233]} 8 {1×1 struct} false false
canFDmsgtable1 = canFDMessageTimetable(mdfData{1},db); canFDmsgtable2 = canFDMessageTimetable(mdfData{2},db)
canFDmsgtimetable2 = 10×12 timetable Time ID Extended Name ProtocolMode Data Length DLC Signals Error Remote BRS ESI _______ __ ________ ________ ____________ _________________________________________________________________________________________________________________________________________________ ______ ___ ____________ _____ ______ _____ _____ 0.1 sec 1 false {'Msg1'} {'CAN FD'} {[ 41 107 214 235 44 169 3 33 187 239 95 95 76 252 16 236 190 212 237 81 6 69 77 153 37 142 81 101 83 5 92 51 236 63 84 22 167 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 0.2 sec 2 false {'Msg2'} {'CAN FD'} {[ 33 16 115 17 139 208 161 90 80 99 145 50 216 246 168 233 249 128 114 64 141 110 121 236 161 43 114 54 146 103 182 118 53 42 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 0.3 sec 3 false {'Msg3'} {'CAN FD'} {[206 67 65 130 111 49 196 115 252 101 157 117 157 47 213 183 155 239 79 68 251 228 47 211 221 25 93 98 135 206 147 125 70 239 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 0.4 sec 4 true {'Msg4'} {'CAN FD'} {[ 168 43 212 126 30 242 118 79 29 221 65 111 200 149 199 191 103 213 104 43 234 224 199 62 135 85 33 63 178 57 244 68 53 210 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 0.5 sec 5 true {'Msg5'} {'CAN FD'} {[97 41 5 128 34 252 129 141 206 123 122 36 76 89 242 171 97 164 230 2 50 215 93 94 11 153 141 99 210 103 157 130 212 85 58 61 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 0.6 sec 6 true {'Msg6'} {'CAN FD'} {[ 109 97 231 199 193 245 237 16 236 40 8 217 215 234 9 226 206 16 176 23 233 130 75 163 147 98 47 35 233 216 16 178 186 187 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 1.1 sec 1 false {'Msg1'} {'CAN FD'} {[ 2 55 212 79 134 69 9 119 147 14 103 20 92 247 123 17 178 140 233 118 107 215 42 65 143 232 212 19 182 75 13 139 58 137 56 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 1.2 sec 2 false {'Msg2'} {'CAN FD'} {[ 145 204 224 85 56 19 218 37 31 26 88 153 136 239 253 159 209 202 250 237 205 141 85 167 40 170 141 137 58 63 24 9 232 1 240 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 1.3 sec 3 false {'Msg3'} {'CAN FD'} {[ 210 134 98 88 95 196 47 59 45 118 88 238 205 2 2 180 48 64 8 10 232 29 102 8 203 97 166 155 180 243 243 99 25 165 1 144 85 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false 1.4 sec 4 true {'Msg4'} {'CAN FD'} {[ 184 7 111 20 68 132 14 154 24 142 37 89 92 158 57 188 146 160 122 153 85 188 183 212 39 136 46 30 39 230 161 20 96 59 160 … ] (1×64 uint8)} 64 15 {1×1 struct} false false true false
Write one data set to a single channel.
blfwrite("newfile.blf",canmsgtable,1,"CAN")
Write two data sets to the same channel.
blfwrite("newfile.blf",{canFDmsgtable2,canFDmsgtable2},[1,1],["CAN FD","CAN FD"])
Write two data sets to separate channels with different protocols.
blfwrite("newfile.blf",{canmsgtable,canFDmsgtable2},[1,2],["CAN","CAN FD"])
Input Arguments
blfFile
— Path to BLF file
string | char
Path to BLF file to write, 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
msgtable
— Data to write to BLF file
timetable
Data to write to BLF file, specified as a timetable of CAN messages or a cell array
of such timetables. You can write multiple tables for the same channel if the protocol
is the same. One way to create timetables from CAN messages is with the function
canMessageTimetable
or canFDMessageTimetable
.
Data Types: timetable
chanID
— Channel IDs
numeric
Channel IDs, specified as a numeric scalar or array value, identifying the channels on which the data is written.
Example: [1,2,4]
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
prot
— Message protocol
"CAN"
| "CAN FD"
Message protocol, specified as "CAN"
or "CAN
FD"
. When writing multiple sets of data, specify protocol as an array of
strings corresponding to the data sets being written.
Example: ["CAN","CAN FD","CAN"]
Data Types: char
| string
Version History
Introduced in R2019a
See Also
Functions
Topics
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)