Main Content

j1939ParameterGroupTimetable

Convert CAN messages or J1939 parameter groups into timetable

Description

Handling parameter group information in a timetable format allows significantly faster processing of J1939 network data across a wide array of workflows.

example

j1939PGTT = j1939ParameterGroupTimetable(msg) takes the input messages as an array of J1939 parameter group objects and returns a J1939 parameter group timetable. The timetable contains the decoded data (PGN, Priority, Data, etc.) from the input J1939 traffic. Use this function to convert J1939 information received as objects in earlier versions of the toolbox to the preferred timetable data type.

j1939PGTT = j1939ParameterGroupTimetable(msg,database) takes the input messages as either a CAN message timetable, an ASAM MDF CAN message timetable, an array of CAN message objects, a CAN message structure from the CAN Log block, an array of J1939 parameter group objects, or an existing J1939 parameter group timetable and returns a J1939 parameter group timetable. If CAN messages are input, the database is used to transform the CAN messages into J1939 parameter groups. If J1939 parameter groups are input, the database is used to re-decode the J1939 parameter group signals.

All CAN message information given as input must originate from a J1939 network. If the provided J1939 database does not contain the information needed to decode the input CAN messages, the output J1939 parameter group timetable is empty.

Examples

collapse all

Convert CAN and J1939 data from various formats.

Convert the output structure from a CAN Log block.

load LogBlockOutput.mat
db = canDatabase("Database.dbc")
j1939PGTT = j1939ParameterGroupTimetable(canMsgs, db)

Convert an array of CAN message objects.

db = canDatabase("Database.dbc")
j1939PGTT = j1939ParameterGroupTimetable(canMsgObjects, db)

Convert a timetable of CAN messages.

db = canDatabase("Database.dbc")
j1939PGTT = j1939ParameterGroupTimetable(canMsgTimetable, db)

Convert ASAM MDF CAN messages.

m = mdf("LogFile.mf4")
mdfData = read(m, 2, m.ChannelNames{2})
db = canDatabase("Database.dbc")
j1939PGTT = j1939ParameterGroupTimetable(mdfData, db)

Convert Vector BLF CAN messages.

blfData = blfread("LogFile.blf", 1)
db = canDatabase("Database.dbc")
j1939PGTT = j1939ParameterGroupTimetable(blfData, db)

Repackage J1939 parameter group objects

db = canDatabase("Database.dbc")
j1939PGTT = j1939ParameterGroupTimetable(j1939PGObjects, db)

Re-decode signals in an existing J1939 parameter group timetable.

db = canDatabase("Database.dbc")
j1939PGTT = j1939ParameterGroupTimetable(j1939PGTimetable, db)

Input Arguments

collapse all

Message data, in one of the following formats:

  • Array of J1939 parameter group objects

  • Timetable of J1939 parameter groups

  • Timetable of CAN messages

  • Timetable of ASAM MDF CAN messages

  • Array of CAN message objects

  • Structure of CAN messages from a CAN Log block

CAN database, specified as a database handle, created with the canDatabase function.

Output Arguments

collapse all

J1939 parameter groups, returned as a timetable.

Introduced in R2021a