| Contents | Index |
Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C6000/ DM6437 EVM
Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C6000/ Scheduling
The CAN Receive block listens to broadcast messages on the DM643x CAN protocol bus. It saves messages with the user-specified Message Identifier to its message buffer. The CAN Receive block polls the message buffer at a rate determined by Sample time. When it detects a message in the message buffer, the block triggers the function-call output (f0) and makes the CAN message data available at the message output (Msg).

Enter a unique number from 0 to 15 for standard or from 0 to 31 for enhanced CAN mode. This field refers to a mailbox area in RAM. In standard mode, the mailbox number determines priority.
Identifies the length of the message—11 bits for standard frame size or 29 bits for extended frame size in decimal, binary, or hex formats. If the format is binary or hex, use bin2dec(' ') or hex2dec(' '), respectively, to convert the entry. The message identifier is associated with a receive mailbox. This mailbox only accepts messages that match the mailbox message identifier.
Select Standard (11-bit identifier) or Extended (29-bit identifier).
Frequency with which the mailbox is polled to determine if a new message has been received. A new message causes a function call to be emitted from the mailbox. To update the message output only when a new message arrives, the block must be executed asynchronously. To execute this block asynchronously, set Sample Time to -1. Refer to Asynchronous Scheduling for a discussion of block placement and other necessary settings.
For information about setting the timing parameters of the CAN module Configuring Timing Parameters for CAN Blocks.
Type of data in the data vector. The length of the vector for the received message is, at most, 8 bytes. If the message is less than 8 bytes, the data buffer bytes are right-aligned in the output. Only uint16 (vector length = 4 elements) or uint32 (vector length = 8 elements) data are allowed. This block uses an 8–byte data buffer to unpack the data, as follows:
For uint16 data,
Output[0] = data_buffer[1..0]; Output[1] = data_buffer[3..2]; Output[2] = data_buffer[5..4]; Output[3] = data_buffer[7..6];
For uint32 data,
Output[0] = data_buffer[3..0]; Output[1] = data_buffer[7..4];
For example, if the received message has two bytes,
data_buffer[0] = 0x21 data_buffer[1] = 0x43
the uint16 output would be:
Output[0] = 0x4321 Output[1] = 0x0000 Output[2] = 0x0000 Output[3] = 0x0000
Select this option to output the message length, in bytes, to the third output port. If you do not select this option, the block has only two output ports.
For detailed information on the CAN module, see TMS320DM643x DMP High-End CAN Controller User's Guide (Rev. A), Literature Number SPRU981, available at the Texas Instruments Web site.
Configuring Timing Parameters for CAN Blocks, DM643x CAN Setup, DM643x CAN Transmit

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |