Main Content

attributeInfo

Information about CAN database attributes

Description

info = attributeInfo(db,'Database',AttrName) returns a structure containing information for the specified database attribute.

If no matches are found in the database, attributeInfo returns an empty attribute information structure.

example

info = attributeInfo(db,'Node',AttrName,NodeName) returns a structure containing information for the specified node attribute.

example

info = attributeInfo(db,'Message',AttrName,MsgName) returns a structure containing information for the specified message attribute.

example

info = attributeInfo(db,'Signal',AttrName,MsgName,SignalName) returns a structure containing information for the specified signal attribute.

example

Examples

collapse all

Create a CAN database object, and view information about its bus type and database version.

db = canDatabase('J1939DB.dbc');
db.Attributes
    'BusType'
    'DatabaseVersion'
    'ProtocolType'
info = attributeInfo(db,'Database','BusType')
            Name: 'BusType'
      ObjectType: 'Database'
        DataType: 'Double'
    DefaultValue: 'CAN-test'
           Value: 'CAN'
info = attributeInfo(db,'Database','DatabaseVersion')
            Name: 'DatabaseVersion'
      ObjectType: 'Database'
        DataType: 'Double'
    DefaultValue: '1.0'
           Value: '8.1'

View node attribute information from CAN database.

db = canDatabase('J1939DB.dbc');
db.Nodes
    'AerodynamicControl'
    'Aftertreatment_1_GasIntake'
    'Aftertreatment_1_GasOutlet'
db.NodeInfo(1).Attributes
    'ECU'
    'NmJ1939AAC'
    'NmJ1939Function'
info = attributeInfo(db,'Node','ECU','AerodynamicControl')
            Name: 'ECU'
      ObjectType: 'Network node'
        DataType: 'Double'
    DefaultValue: 'ECU-1'
           Value: 'ECU-10'

View message attribute information from CAN database.

db = canDatabase('J1939DB.dbc');
db.Messages
    'A1'
    'A1DEFI'
    'A1DEFSI'
db.MessageInfo(1).Attributes
a = db.MessageInfo(1).Attributes
a = 
    'GenMsgCycleTime'
    'GenMsgCycleTimeFast'
    'GenMsgDelayTime'
    'VFrameFormat'
info = attributeInfo(db,'Message','GenMsgCycleTime','A1')
            Name: 'GenMsgCycleTime'
      ObjectType: 'Message'
        DataType: 'Undefined'
    DefaultValue: 0
           Value: 500

View message signal attribute information from CAN database.

db = canDatabase('J1939DB.dbc');
s = signalInfo(db,'A1')
s = 
2x1 struct array with fields:
    Name
    Comment
    StartBit
    SignalSize
    ByteOrder
    Signed
    ValueType
    Class
    Factor
    Offset
    Minimum
    Maximum
    Units
    ValueTable
    Multiplexor
    Multiplexed
    MultiplexMode
    RxNodes
    Attributes
    AttributeInfo
s(1).Name
EngBlowerBypassValvePos
s(1).Attributes
    'GenSigEVName'
    'GenSigILSupport'
    'GenSigInactiveValue'
info = attributeInfo(db,'Signal','GenSigInactiveValue','A1','EngBlowerBypassValvePos')
            Name: 'GenSigInactiveValue'
      ObjectType: 'Signal'
        DataType: 'Undefined'
    DefaultValue: 0
           Value: 0

Input Arguments

collapse all

CAN database, specified as a CAN database object.

Example: db = canDatabase(_____)

Attribute name, specified as a character vector or string.

Example: 'BusType'

Data Types: char | string

Node name, specified as a character vector or string.

Example: 'AerodynamicControl'

Data Types: char | string

Message name, specified as a character vector or string.

Example: 'A1'

Data Types: char | string

Signal name, specified as a character vector or string.

Example: 'EngBlowerBypassValvePos'

Data Types: char | string

Output Arguments

collapse all

Attribute information, returned as a structure with these fields:

FieldDescription
NameAttribute name
ObjectTypeType of attribute
DataTypeData class of attribute value
DefaultValueDefault value assigned to attribute
ValueCurrent value of attribute

Version History

Introduced in R2015b