CAN Transmit
This block handles transmitting messages via the CAN bus in STM microcontrollers.

Table of Contents
Inputs
| Input Name | Type | Description |
|---|---|---|
| Data[ ] | uint8 | Data to send. The number of bytes at the input depends on the input or parameter Data length. |
| Set ExtID | bool | Optional input ID number type of the message to send (Standard or Extended). This input is optional and depends on the Enable input ID type parameter. |
| ID | uint32 | Optional input ID number of the message to send. This input is optional and depends on the Enable input ID parameter. |
| Data length | uint8 | Optional input Amount of data to send. This input is optional and depends on the Enable input length of data parameter. |
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | Transmission status. Returns:1 transmission successful0 transmission failed |
Block Parameters
| Parameter | Description |
|---|---|
| Module number | CAN module number |
| Enable input ID type | Enables the Set ExtID input |
| ID Type | Conditional Parameter Message ID number type: Standard ID - standard number (11 bits)Extended ID - extended number (29 bits)This parameter is available if the Enable input ID type option is disabled. |
| Enable input ID | Enables the ID input |
| ID | Conditional Parameter ID number of the message to send. This parameter is available if the Enable input ID option is disabled. |
| Enable input length of data | Enables the Data length input |
| Data length | Conditional Parameter Maximum data length per frame (in bytes). This parameter is available when the Enable input length of data option is disabled. |
| Frame repeat | Number of repetitions of the same frame. This setting allows the sent frame to be automatically repeated a specified number of times without needing to call the block again. |
| Behavior when queue full | Block behavior when the transmission queue is full:Discard new packets - discards new frames when the queue is fullOverwrite first packet - overwrites the newest frames in the queue when fullOverwrite last packet - overwrites the oldest frames in the queue when full |
| Immediately | Execution of the action specified in the Behavior when queue full parameter immediately after the block invocation, without waiting for data transmission to complete. |
| Timeout | Conditional Parameter Specifies how long the system will wait for the buffer to clear before executing the action defined in Behavior when queue full. This parameter is available when the Immediately option is disabled. |
| Wait for end sending | Executes the block until data is sent or the time set in the Timeout parameter expires. If this option is disabled, the block returns a success status immediately after placing the message in the transmission queue, without waiting for its actual transmission. |
| Timeout | Conditional Parameter How long the system will wait for the block execution. This parameter is available when the Wait for end sending option is disabled. |
| Sample time [s] | Function refresh rate |

CubeMX Configuration for a Given MCU
Configuration for CAN can be found on the CubeMX Configuration for a Given MCU subpage.
See Also
Last updated on