CAN Transmit

Transmit message to CAN network

  • Library:
  • Simulink Support Package for Raspberry Pi Hardware

Description

The CAN Transmit block transmits messages to the CAN network. This block works only with CAN shield based on MCP2515. For information on MCP2515, see MCP2515.

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

Ports

Input

expand all

Message data, specified as vector or scalar.

Data Types: uint8 | CAN Msg

Output

expand all

Output status.

Dependencies

To enable this parameter, select Output Status

Parameters

expand all

Data input type used for transmitting messages.

Select this option to indicate the status of message transfer. Status port outputs 0 for successful transmit and error codes in case of failure. Error codes are listed in this table.

0000ABTFMLOATXERRTXBOTXEPTXWAR
bit7bit6bit5bit4bit3bit2bit1bit0

ABTF: Message Aborted Flag bit

MLOA: Message Lost Arbitration bit

TXERR: Transmission Error Detected bit

TXBO: Bus-Off Error Flag bit

TXEP: Transmit Error-Passive Flag bit

TXWAR: Transmit Error Warning Flag bit

When selected, the block waits for the time specified in the Time out in seconds parameter before transferring data.

Wait time for transferring data. After the specified time, the block times out.

Dependencies

To enable this parameter, select Wait until data sent.

Message identifier, which is 11 bits long for the standard frame or 29 bits long for the extended frame, 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 is input as to Raw data.

Message identifier type.

Dependencies

To enable this parameter, set Data is input as to Raw data.

Message length, in bytes. The maximum supported length is 8 bytes.

Dependencies

To enable this parameter, set Data is input as to Raw data.

When selected, this block sends request for remote frames.

Dependencies

To enable this parameter, set Data is input as to Raw data.

See Also