Table of Contents
The CAN output mailbox block allows sending CAN messages with up to 8 bytes long payloads. To receive messages with payloads of up to 8 bytes, the CAN input mailbox should be used.
It supports two operating modes:
- On-demand mode: the user manually triggers the message transmissions.
- Periodical mode: the message is sent periodically, whether the data has been changed or not. The user can configure the transmission frequency.
The CAN frame unique identifier also represents the message priority. Therefore, frames with low identifiers will have the highest priority.
Only the CAN base frame format is supported, extended frame format is not. Therefore, the CAN address is limited to 11 bits (0 to 2047).
Simulink block
Signal specification
- The data input signal supports a vector of data. The accepted data type is configured by
Signal type
parameter. The vector length can be configured withNumber of signals
parameter. - The second input is the send data signal. It is used to initiate a data transmission when the on-demand mode has been selected. Data is sent upon a rising edge on this signal.
Parameters
CAN address
: sets the CAN output mailbox address. It also sets the CAN unique identifier of the data frame.Signal Type
: defines the data type accepted in the data input (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 sent. Either little-endian or big-endian.Tx frequency
: Sets the data transmission frequency if the periodical mode has been selected.Baud rate
: configures the baud rate of the CAN bus. Baud rates up to 1 Mbit/s are supported.
The total number of bits sent by CAN output mailbox (resulting from
Signal type
and Number of signals
) can not exceed 64 bits (8 bytes), which is the maximum payload of a CAN frame.PLECS block
The CAN baud rate can be configured in the Imperix Controllers’ target window (Coder → Coder option → Target).
Signal specification
- The data input signal supports a vector of data. The accepted data type is configured by
Signal type
parameter. The vector length can be configured withNumber of signals
parameter. - The second input is the send data signal. It is used to initiate a data transmission when the on-demand mode has been selected. Data is sent upon a rising edge on this signal.
Parameters
CAN address
: sets the CAN output mailbox address. It also sets the CAN unique identifier of the data frame.Signal Type
: defines the data type accepted in the data input (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 sent. Either little-endian or big-endian.Tx frequency
: sets the data transmission frequency if the periodical mode has been selected.
The total number of bits sent by CAN output mailbox (resulting from
Signal type
and Number of signals
) can not exceed 64 bits (8 bytes), which is the maximum payload of a CAN frame.