Main Content

CAN Receive

Receive message from CAN network

  • Library:
  • Simulink Support Package for Raspberry Pi Hardware / Communication

Description

The CAN Receive block receives messages from the CAN network. This block works only with CAN shield based on MCP2515. For information on MCP2515, see MCP2515. and delivers them to the Simulink® model.

The CAN Receive block supports Raw data and CAN Msg as output types. To use CANdb (CAN database) file or to specify signals manually, use CAN Msg output type and CAN Unpack block. The CAN Unpack block is available from the Vehicle Network Toolbox. For information on CAN Unpack, see CAN Unpack.

Ports

Output

expand all

Received message data, returned as a vector or scalar.

Data Types: uint8 | CAN Msg

Status of the received output message.

Data Types: uint8

Error codes.

Dependencies

To enable this parameter, select Output Error.

00000000RXWARRXEPRX0OVRRX1OVR
bit7bit6bit5bit4bit3bit2bit1bit0

RX1OVR: Receive Buffer 1 Overflow Flag bit

RX0OVR: Receive Buffer 0 Overflow Flag bit

RXEP: Receive Error-Passive Flag bit

RXWAR: Receive Error Warning Flag bit

Remote message flag.

Dependencies

To enable this parameter, select Output Remote.

Parameters

expand all

Data type used for receiving messages.

Message identifier type.

Dependencies

To enable this parameter, set Data to be output as to Raw data.

Message identifier, which is 11 bits long for the standard frame size or 29 bits long for the extended frame size, specified in decimal, binary, or hex. For binary and hex formats, use bin2dec(' ') and hex2dec(' '), respectively, to convert the entry. The message identifier is coded into a message that is sent to the CAN bus.

Dependencies

To enable this parameter, set Data to be output as to Raw data.

Message length.

Dependencies

To enable this parameter, set Data to be output as to Raw data.

Sample time.

Select to output error codes if the message transfer fails.

Select to output remote messages.

See Also