MCAN Receive
Libraries:
C2000 Microcontroller Blockset /
F2838x /
M4
C2000 Microcontroller Blockset /
F280015x
C2000 Microcontroller Blockset /
F28003x
C2000 Microcontroller Blockset /
F2838x /
C28x
C2000 Microcontroller Blockset /
F28p55x
C2000 Microcontroller Blockset /
F28p65x
Description
The MCAN Receive block reads messages from a Controller Area Network (CAN) connected to the hardware.
In the Unpacked mode, the block outputs different fields of unpacked CAN Messages.
In the Packed mode, the block outputs a Simulink® bus signal. To extract data from the Simulink bus signal, connect it to a CAN-FD Unpack block.
The MCAN Receive block receives messages from the CAN and delivers them to the Simulink model. It outputs one message or all messages at each time step, depending on the block parameters. The MCAN Receive block stores CAN messages received from the bus in a first-in, first-out (FIFO) or buffer. The FIFO or buffer delivers the messages to your model in the queued order at every time step.
Note
For MCAN Receive block, if the data is not available, the output status shows the previously received data.
When the Output type is packed and MCAN Receive block is connected to CAN FD Unpack block, the values of the
error
,error state indicator (ESI)
,reserved
, andtimestamp
fields of the received message are set to0
and these values are reflected on the output of CAN FD Unpack block.
In receive output status we should mention the current behavior when data is not available. The output data will be retained to its previously received value in case of data is not available.
The number of elements to be stored in FIFO is configured in configuration parameters. In case of buffers, the new data will not be stored unless the old data is read.
The FIFO, blocking or overwrite mode settings are configured in the MCAN.
Specify the Output type and its properties using the block parameters dialog box. Configure additional properties of the CAN module in the Configuration Parameters. For more refer to Model Configuration Parameters for Texas Instruments C2000 Processors.
Ports
Output
Parameters
Version History
Introduced in R2021a