Main Content

attachDatabase

Attach CAN database to messages and remove CAN database from messages

Description

example

attachDatabase (message,database) attaches the specified database to the specified message. You can then use signal-based interaction with the message data, interpreting the message in its physical form.

attachDatabase (message,[]) removes any attached database from the specified message. You can then interpret messages in their raw form.

Examples

collapse all

Attach Database.dbc to a received CAN message.

candb = canDatabase('C:\Database.dbc')
message = receive(canch,Inf)
attachDatabase(message,candb)

Input Arguments

collapse all

The name of the CAN message that you want to attach the database to or remove the database from, specified as a CAN message object.

Example: message = receive(canch,Inf)

Handle of database (.dbc file) that you want to attach to the message or remove from the message, specified as a canDatabase handle.

Example: candb = canDatabase('C:\Database.dbc')

Tips

If the specified message is an array, then the database attaches itself to each entry in the array. The database attaches itself to the message even if the message you specified does not exist in the database. The message then appears and operates like a raw message. To attach the database to the CAN channel directly, edit the Database property of the channel object.

Version History

Introduced in R2009a

See Also

Functions