canMessageTimetable
Convert CAN messages into timetable
Description
creates a CAN message timetable from existing raw messages. The output message timetable
contains the raw message information (ID, Extended, Data, etc.) from the messages. If CAN
message objects are input which contain decoded information, that decoding is retained in the
CAN message timetable. A timetable of CAN message data can often provide better performance than
using CAN message objects.msgtimetable
= canMessageTimetable(msg
)
uses the database to decode the message names and signals for the timetable along with the raw
message information. Specify multiple databases in an array to decode message names and signals
in the timetable within a single call. msgtimetable
= canMessageTimetable(msg
,database
)
The input msg
can also be a timetable of data created by using mdfRead
on an MDF file.
In this case, the function converts the timetable of ASAM standard logging format data to a
Vehicle Network Toolbox™ CAN message timetable.
Examples
Convert Log Block Output to Timetable
Convert log block output to a CAN message timetable.
load LogBlockOutput.mat db = canDatabase('myDatabase.dbc') msgTimetable = canMessageTimetable(canMsgs,db)
Convert CAN Message Objects to Timetable
Convert legacy CAN message objects to a CAN message timetable.
msgTimetable = canMessageTimetable(canMsgs);
Decode Message Timetable with Database
Decode an existing CAN message timetable with a database.
db = canDatabase('myDatabase.dbc')
msgTimetable = canMessageTimetable(msgTimetable,db)
Convert an ASAM MDF Message Timetable
Convert an existing ASAM format message timetable, and decode using a database.
db = canDatabase('dbFiles\dGenericVehicle.dbc'); mdfData = mdfRead('mdfFiles\CANonly.MF4'); msgTimetable = canMessageTimetable(mdfData{1},db);
Compare the two timetables.
mdfData{1}
ans = 795×9 timetable with 0 events t CAN_DataFrame.DataLength CAN_DataFrame.WakeUp CAN_DataFrame.SingleWire CAN_DataFrame.IDE CAN_DataFrame.ID CAN_DataFrame.Flags CAN_DataFrame.DLC CAN_DataFrame.DataBytes CAN_DataFrame.BusChannel ____________ ________________________ ____________________ ________________________ _________________ ________________ ___________________ _________________ _______________________ ________________________ 0.019968 sec 4 0 0 0 100 0 4 {[100 0 0 0]} 1 0.029964 sec 4 0 0 0 100 0 4 {[108 0 0 0]} 1 0.039943 sec 4 0 0 0 100 0 4 {[116 0 0 0]} 1 0.049949 sec 4 0 0 0 100 0 4 {[124 0 0 0]} 1 0.059945 sec 4 0 0 0 100 0 4 {[132 0 0 0]} 1 0.070001 sec 4 0 0 0 100 0 4 {[140 0 0 0]} 1 : : : : : : : : : : 7.9003 sec 4 0 0 0 100 0 4 {[ 44 3 0 0]} 1 7.9204 sec 4 0 0 0 100 0 4 {[ 52 3 0 0]} 1 7.9303 sec 4 0 0 0 100 0 4 {[ 60 3 0 0]} 1 7.9305 sec 4 0 0 0 100 0 4 {[ 68 3 0 0]} 1 7.9404 sec 4 0 0 0 100 0 4 {[ 76 3 0 0]} 1 7.9604 sec 4 0 0 0 100 0 4 {[ 84 3 0 0]} 1
msgTimetable
msgTimetable = 795×8 timetable Time ID Extended Name Data Length Signals Error Remote ____________ ___ ________ __________ _____________ ______ ____________ _____ ______ 0.019968 sec 100 false {0×0 char} {[100 0 0 0]} 4 {0×0 struct} false false 0.029964 sec 100 false {0×0 char} {[108 0 0 0]} 4 {0×0 struct} false false 0.039943 sec 100 false {0×0 char} {[116 0 0 0]} 4 {0×0 struct} false false 0.049949 sec 100 false {0×0 char} {[124 0 0 0]} 4 {0×0 struct} false false 0.059945 sec 100 false {0×0 char} {[132 0 0 0]} 4 {0×0 struct} false false 0.070001 sec 100 false {0×0 char} {[140 0 0 0]} 4 {0×0 struct} false false : : : : : : : : : 7.9003 sec 100 false {0×0 char} {[ 44 3 0 0]} 4 {0×0 struct} false false 7.9204 sec 100 false {0×0 char} {[ 52 3 0 0]} 4 {0×0 struct} false false 7.9303 sec 100 false {0×0 char} {[ 60 3 0 0]} 4 {0×0 struct} false false 7.9305 sec 100 false {0×0 char} {[ 68 3 0 0]} 4 {0×0 struct} false false 7.9404 sec 100 false {0×0 char} {[ 76 3 0 0]} 4 {0×0 struct} false false 7.9604 sec 100 false {0×0 char} {[ 84 3 0 0]} 4 {0×0 struct} false false
Input Arguments
msg
— CAN message data
timetable, array, or structure
CAN message data, specified as one of the following:
Array of
can.Message
objectsTimetable of CAN messages
Timetable of ASAM MDF CAN messages
Struct of CAN messages from a CAN Log block
database
— CAN database
database
handle
CAN database, specified as a database handle.
Output Arguments
msgtimetable
— CAN message timetable
timetable
CAN messages returned as a timetable.
Version History
Introduced in R2017a
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)