Main Content

messageInfo

Information about CAN database messages

Description

example

msgInfo = messageInfo(candb) returns a structure with information about the CAN messages in the specified database candb.

example

msgInfo = messageInfo(candb,msgName) returns information about the specified message 'msgName'.

example

msgInfo = messageInfo(candb,id,msgIsExtended) returns information about the message with the specified standard or extended ID.

Examples

collapse all

Get information from all messages in a CAN database.

candb = canDatabase('J1939DB.dbc');
msgInfo = messageInfo(candb)
msgInfo = 
3x1 struct array with fields:
    Name
    Comment
    ID
    Extended
    J1939
    Length
    Signals
    SignalInfo
    TxNodes
    Attributes
    AttributeInfo

You can index into the structure for information on a particular message.

Get information from one message in a CAN database using the message name.

candb = canDatabase('J1939DB.dbc');
msgInfo = messageInfo(candb,'A1')
msgInfo = 
             Name: 'A1'
          Comment: 'This is an A1 message'
               ID: 419364350
         Extended: 1
            J1939: [1x1 struct]
           Length: 8
          Signals: {2x1 cell}
       SignalInfo: [2x1 struct]
          TxNodes: {'AerodynamicControl'}
       Attributes: {4x1 cell}
    AttributeInfo: [4x1 struct]

Get information from one message in a CAN database using the message ID.

candb = canDatabase('J1939DB.dbc');
msgInfo = messageInfo(candb,419364350,true)
msgInfo = 
             Name: 'A1'
          Comment: 'This is an A1 message'
               ID: 419364350
         Extended: 1
            J1939: [1x1 struct]
           Length: 8
          Signals: {2x1 cell}
       SignalInfo: [2x1 struct]
          TxNodes: {'AerodynamicControl'}
       Attributes: {4x1 cell}
    AttributeInfo: [4x1 struct]

Input Arguments

collapse all

CAN database, specified as a CAN database object. candb identifies the database containing the CAN messages that you want information about.

Example: candb = canDatabase(_____)

Message name, specified as a character vector or string. Provide the name of the message you want information about.

Example: 'A1'

Data Types: char | string

Message ID, specified as a numeric value. id is the numeric identifier of the specified message, in either extended or standard form.

Example: 419364350

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

Message ID format, specified as a logical. Specify whether the message ID is in standard or extended type. Use the logical value true if extended, or false if standard. There is no default; you must provide this argument when using a message ID.

Example: true

Data Types: logical

Output Arguments

collapse all

Message information, returned as a structure or array of structures for the specified CAN database and messages.

Version History

Introduced in R2009a