Skip to Content

Host Serial Transmit Block Description

This block is used to transmit (send) a data stream via the host’s serial communication port (UART/USART). It allows for automatic wrapping of the transmitted packet in a defined header and terminator.

To use the block, you must first configure the host serial port using the Host Serial Setup block.



Host Serial Transmit block

Table of Contents

Inputs

Input NameTypeDescription
Datauint8Raw input data intended for transmission via the serial port.

Outputs

This block does not have any outputs.

Block Parameters

ParameterDescription
Communication portSelection of the serial port (COM) responsible for data transmission.
HeaderA sequence of bytes that starts and identifies a valid data frame.
TerminatorA sequence of characters or bytes defining the end of the transmitted data frame.
Enable blocking modeAn option enforcing the blocking mode of operation (locked as active for this type of transmission operation).

The Header and Terminator parameters accept byte value arrays in MATLAB notation, which define the start and end of the frame. Characters can be entered directly in single quotes or as numerical values using conversion functions:

  • Mixed format (array): Entries are enclosed in square brackets, separating elements with a space or a comma, e.g., ['A' hex2dec('41')].
  • ASCII characters: Single characters are defined in single quotes, e.g., 'A' (which corresponds to the value 0x41).
  • Hex/Dec values: To enter pure hexadecimal values, use the hex2dec('hex_value') function, e.g., hex2dec('41') will return the value 65 in the decimal system. Do not type the 0x prefix before the hexadecimal value, as this will cause an error in interpreting the value.


Parameters for Host Serial Transmit block

CubeMX Configuration for a Given MCU Model

It is not possible to configure parameters in CubeMX for this block.

See Also

Last updated on