主要内容

Serial Receive

R2026b

Read data from the UART port

Since R2026b

  • TC4x Serial Receive block icon

Libraries:
Embedded Coder Support Package for Infineon AURIX TC4x Microcontrollers / AURIX TC4x

Description

Add-On Required: This feature requires the Embedded Coder Support Package for Infineon AURIX TC4x Microcontrollers add-on.

The Serial Receive block reads data from the Universal Asynchronous Receiver Transmitter (UART) port on an Infineon® AURIX™ TC4x Microcontroller board.

To configure serial block peripherals, see Serial Peripheral Configuration.

Ports

Input

expand all

Specify the length in bytes of the data to receive. The value must be less than or equal to Maximum Rx data length parameter value.

Dependencies

To enable this port, select the Enable input port for read length parameter.

Data Types: uint16

Output

expand all

The port outputs the values received from the UART port on the hardware board. The size of the data vector depends on the value you specify in the Maximum Rx data length parameter.

Data Types: uint8 | int8 | uint16 | int16 | uint32 | int32 | single | double

The port outputs the number of data bytes in the received message.

Dependencies

To enable this port, set Receive mode to Receive without waiting and select the Output partially received data parameter.

Data Types: uint16

The port outputs the data reception status indicator as either 0 or 1.

  • 0 — Successful read operation.

  • 1 — No new data available for read operation.

Dependencies

To enable this port, select the Enable status parameter.

Data Types: uint8

Parameters

expand all

Basic

Select the data type of the data to receive from the UART port on the hardware board.

Dependencies

Specify the length of the data to be received in bytes.

Select this parameter to enable the Status port, which outputs the read status.

Specify in seconds how often the block reads data from the UART port on the hardware board.

When you specify -1, Simulink® determines the sample time based on the block context within the model.

Advanced

Select one of these operation modes:

  • Receive without waiting — Receive data from the peripheral device without waiting for the stop bits. This mode enables the Output partially received data parameter, which you can use to output the number of data bytes in the partially received data through the outLen port.

  • Wait until data available — Receive data in blocking mode, in which the block waits until it receives the full data length before processing the data

Specify the maximum time in seconds to wait to receive the serial data.

Dependencies

To enable this parameter, set Receive mode to Wait until data available.

Select this parameter to enable the outLen port, which outputs the number of data bytes in the partially received data.

Dependencies

To enable this parameter, set Receive mode to Receive without waiting.

Select this parameter to enable the inLen port, which accepts the length in bytes of the data to receive.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2026b