CAN in – CAN input mailbox
Table of Contents
The CAN input mailbox block allows receiving CAN messages with up to 8 bytes long payloads.
It reads frames from the CAN bus and if the frame address matches the mailbox address, the data is applied to the output port of the block. The CAN input mailbox block features a second output that indicates that new data has been received. The value on the output data port will remain unchanged until new data are received.
Simulink block
Signal specification
- The data output signal returns a vector containing the data read from the CAN bus. The vector length can be configured with the
Number of signals
parameter. The output data type is configured by theSignal type
parameter. - The second signal is the data valid output. It is set to 1 each time new data are available.
Parameters
CAN address
: sets the CAN input mailbox address. If a CAN frame with a matching address is received the frame data is applied to the data output port of the block.Signal Type
: defines the type of the data output (int8, uint8, int16, uint16, int32, uint32, in64, uint64, float, or double).Number of signals
: sets the vector length of the data output. (from 1 to 8)Byte order
: defines the byte order in which the data will be read. (little-endian or big-endian)Initial value
: sets the initial data value of the data output before any data are received. The value is interpreted as a uint64.Baud rate
: configures the baud rate of the CAN bus. Baud rates up to 1 Mbit/s are supported.
Signal type
and Number of signals
) can not exceed 64 bits (8 bytes), which is the maximum payload of a CAN frame.PLECS block
Signal specification
- The data output signal returns a vector containing the data read from the CAN bus. The vector length can be configured with the
Number of signals
parameter. The output data type is configured by theSignal type
parameter. - The second signal is the data valid output. It is set to 1 each time new data are available.
Parameters
CAN address
: sets the CAN input mailbox address. If a CAN frame with a matching address is received the frame data is applied to the data output port of the block.Signal Type
: defines the type of to the data output (int8, uint8, int16, uint16, int32, uint32, in64, uint64, float, or double).Number of signals
:sets the vector length of the data output.Byte order
: defines the byte order in which the data will be read. (little-endian or big-endian)Initial value
: sets the initial data value of the data output before any data is received. The value is interpreted as a uint64.Baud rate
: configures the baud rate of the CAN bus. Baud rates up to 1 Mbit/s are supported.
Signal type
and Number of signals
) can not exceed 64 bits (8 bytes), which is the maximum payload of a CAN frame.