CAN Receive
This block handles receiving messages via the CAN bus in STM microcontrollers.

Table of Contents
Inputs
This block does not have any inputs.
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | Transmission status. Returns:1 transmission successful0 transmission failed |
| ID | uint32 | ID number of the received message. |
| DLC | uint8 | Data length of the received frame. |
| Data[ ] | uint8 | Data from the received frame. |
Block Parameters
| Parameter | Description |
|---|---|
| Module number | CAN module number |
| ID Type | Message ID number type:Standard ID - standard number (11 bits)Extended ID - extended number (29 bits) |
| Init filter in loop | Enables initialization of the filter on every block execution loop |
| Type | Message filtering method selection:CAN_FILTERMODE_IDMASK - filtering messages by maskCAN_FILTERMODE_IDLIST - filtering messages by ID numbers |
| Config FIFO | Receive buffer configuration:CAN_FILTER_FIFO0 - messages are received into FIFO0 bufferCAN_FILTER_FIFO1 - messages are received into FIFO1 buffer |
| ID | Conditional Parameter Message ID number used for filtering. This setting is visible only when the Type parameter is configured as CAN_FILTERMODE_IDMASK. |
| Mask | Conditional Parameter Mask used for message filtering. This setting is visible only when the Type parameter is configured as CAN_FILTERMODE_IDMASK. |
| ID1 | Conditional Parameter Message ID number used for filtering. This setting is visible only when the Type parameter is configured as CAN_FILTERMODE_IDLIST. |
| ID2 | Conditional Parameter Message ID number used for filtering. This setting is visible only when the Type parameter is configured as CAN_FILTERMODE_IDLIST. |
| Data length (bytes) | Maximum data length per frame (in bytes) |
| Num of buffer | Number of receive buffers. This setting affects the amount of messages that can be stored in the receive buffer before being processed. |
| Data output mode | Way data from the received frame is represented:Matrix - data is represented as a matrixVectors - data is represented as vectors |
| Timeout | How long the system will wait for the block execution |
| Sample time [s] | Function refresh rate |

CubeMX Configuration for a Given MCU
Configuration for CAN can be found on the CubeMX Configuration for a Given MCU subpage.
See Also
Last updated on