The CAN Receive Workflow shows how to receive and unpack CAN messages, using receive and unpack functions. You can also use the CAN Receive block to build a receive Simulink block.
||Receive messages from CAN bus|
||Attach CAN database to messages and remove CAN database from messages|
||Set CAN channel offline|
||Unpack signal data from message|
|MessageReceivedFcn||Specify function to run|
|MessageReceivedFcnCount||Specify number of messages available before function is triggered|
|MessagesAvailable||Display number of messages available to be received by CAN channel|
|MessagesReceived||Display number of messages received by CAN channel|
|MessagesTransmitted||Display number of messages transmitted by CAN channel|
After your channel is online, use the
receive function to receive available messages.
After your channel receives a message, specify how to unpack the message and interpret the data in the message.
How to receive data via a CAN network.