Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Receive Messages

Message reception via CAN channels

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.

Functions

receive Receive messages from CAN bus
attachDatabase Attach CAN database to messages and remove CAN database from messages
stop Set CAN channel offline
unpack Unpack signal data from message
extractAll Select all instances of message from message array
extractRecent Select most recent message from array of messages
extractTime Messages occurring within specified time range

Properties

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
InitialTimestamp Indicate when channel started
Timestamp Display message received timestamp
ReceiveErrorCount Display number of received errors detected by channel
TransmitErrorCount Display number of transmitted errors by channel

Blocks

CAN Receive Receive CAN messages from specified CAN device
CAN Unpack Unpack individual signals from CAN messages
CAN Log Log received CAN messages

Examples and How To

Receive a Message

After your channel is online, use the receive function to receive available messages.

Unpack a Message

After your channel receives a message, specify how to unpack the message and interpret the data in the message.

Build a Message Receive Model

How to receive data via a CAN network.

Concepts

Vehicle Network Communication Examples

Connecting to your CAN hardware and communicating over a CAN

Build CAN Communication Simulink Models

Examples of using Vehicle Network Toolbox™ blocks.

Was this topic helpful?