Embedded Target for Motorola MPC555 | ![]() ![]() |
Read CAN messages from a Vector CAN channel
Library
Description
The Vector CAN Receive block reads CAN messages from the channel specified by the Configuration tag parameter. The block has the following outputs:
f()
(function call trigger): The Vector CAN Receive block polls the CAN channel and outputs a trigger from this port when a message or messages are available. The function call trigger output should be connected to the trigger input of a function call subsystem that will process the message when triggered.
Msg
: This port outputs the CAN message received. Connect this port to a Function Call subsystem that will process the message when triggered.
Timestamp
, is added to the block. See Output timestamp.
For an example of the use of the Vector CAN Receive and Transmit blocks, see the mpc555rt_io and mpc555rt_iohost demos.
Message Queuing
The Vector Can driver allocates a message queue to each Vector CAN Receive block. A message queue has a maximum size of 1024 messages. As messages are received from the CAN network, they are put into the appropriate queue.
When the Vector CAN Receive block executes, it polls the queue to see how long it is. If Loop to clear message queue is selected, then the block will read all messages from the queue and process them sequentially. If more messages arrive during this process, they are added to the end of the queue and processed the next time the Vector CAN Receive block executes. We recommend that you select the Loop to clear message queue option, to avoid overflowing the block's message queue.
If Loop to clear message queue is not selected, the Vector CAN Receive block processes only a single message from the queue is processed when the Vector CAN Receive block executes. Any other messages remain in the queue until handled by subsequent executions of the Vector CAN Receive block.
No messages are lost and no errors are reported until the queue size for a particular Vector CAN Receive block exceeds maximum length of 1024 messages.
Dialog Box
Standard (11 bit identifier)
or Extended (29 bit identifier)
.Timestamp
, is added to the Vector CAN Receive block.![]() | Vector CAN Configuration | Vector CAN Transmit | ![]() |