CAN Transmit
Purpose
Transmit CAN messages
Library
STM32
Description
The CAN Transmit block sends out data on a CAN bus. The data to send must be provided on the block input dx as a vectorized signal with data type uint8. The length of the transmitted CAN message is determined by the width of the input signal (1 to 8 bytes for CAN2.0 and 1 to 64 bytes for CAN FD).
Messages are either sent regularly with a fixed sample time or on demand when the trigger input changes. When configured for triggered execution, messages are sent when the trigger signal changes in the manner specified by the Trigger type parameter:
- rising
Data is sent when the trigger signal changes from \(0\) to a non-zero value.
- falling
Data is sent when the trigger signal changes from a non-zero value to \(0\).
- either
Data is sent when the trigger signal changes from \(0\) to a non-zero value or vice versa.
Parameters
- CAN interface
Selects the CAN interface to use. The selected CAN interface must be configured using a CAN Port block.
- CAN ID source
Selects whether the CAN identifier (ID) is specified as a parameter or is supplied as an input signal.
- CAN ID
The ID for which the block transmits a CAN message. The CAN ID can be supplied as either 11-bit value(s) (for CAN 2.0A) or a 29-bit value(s) (for CAN 2.0B).
- Frame format
Specifies the frame format of the CAN messages to be transmitted. Possible values are:
Standard CAN for CAN 2.0A messages with an 11-bit ID. The standard 11-bit ID provides for \(\mathrm{2^{11}}\), or \(2048\) different message identifiers.
Extended CAN for CAN 2.0B messages with an 29-bit ID. The extended 29-bit ID provides for \(\mathrm{2^{29}}\), or \(537\) million identifiers.
Auto uses the Standard format if the specified CAN ID is smaller than \(2047\). Otherwise, the Extended format is used.
- Execution
Selects between regular and triggered execution.
- Trigger type
The direction of the edges of the trigger signal upon which the data is sent, as described above (for triggered execution only).
- Offline simulation
Enables or disables data inspection in an offline simulation. If set to enable, terminals are added to the subsystem in the top-level schematic. If set to disable, no such terminals are added to the subsystem.