CAN Write
Add-On Required: This feature requires the Embedded Coder Support Package for STMicroelectronics STM32 Processors add-on.
Libraries:
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F2xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F3xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32L4xx Based Boards
Simulink Coder Support Package for STMicroelectronics Nucleo Boards /
STM32H7
Description
The CAN Write block writes messages to the Controller Area Network (CAN) network connected to the hardware.
The CAN Write block accepts a CAN data that needs to be sent when operation
mode is set to Data
. The block accepts a 1-D array of type
uint8
when data format is set to Raw data
.
The block accepts input as Simulink® bus signal when data format is set to CAN Message
. To extract
data from Simulink bus signal, connect it to CAN pack block.
Note
When the length of data (input array) is different than the length (input scalar), the number of data transmitted over the CAN module is minimum of length of data or input length.
Select the Operation mode and its properties using the block parameters dialog box. Configure the properties of CAN module in the Model Configuration Parameters for STM32 Processor Based Boards.
Examples
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2023a