Read N-by-1 array of data on UART
Simulink Coder Support Package for BBC micro:bit / Basic
Simulink Coder Support Package for STMicroelectronics Nucleo Boards / Common
Simulink Coder Support Package for STMicroelectronics Discovery Boards / STM32F746G-Discovery
Simulink Coder Support Package for STMicroelectronics Discovery Boards / STM32F769I-Discovery
The SCI Read block reads an N-by-1 array of data from the Universal Asynchronous Receiver Transmitter (UART), where N is the length of data to be read. You can change the Baudrate and select the Receive pin for the UART Serial Communication Interface (SCI) from Configuration Parameters > Hardware Implementation pane > SCI.
During external mode simulation, the block outputs the simulation results returned from the executable running on the target hardware. During simulation in all other modes, the block outputs zeroes.
This block operates in nonblocking mode.
Rx— Data read from UART
The port outputs the data read from the selected UART.
Status— Status of read operation
When the length of data received is greater than or equal to
the length specified in the Data length (N) parameter,
the output is
0. Otherwise, the output is a nonzero
value, indicating that the length of data available is less than the
length specified in the Data length (N) parameter.
0 indicates a successful read operation.
For example, when the length of data received is 9 and N = 8, the
Status port outputs
indicating a successful read operation. When the length of data received
is 9 and N = 10, the Status port
32 indicating that data is not
|Length of Data Received = 9|
|Port||Data Type||Data Length|
|N = 8||N = 9||N = 10|
To enable the port, select the Output status parameter.
SCI module— SCI module used for communications
0(default) | Any integer value
SCI module to which the SCI device is connected.
In external mode, the SCI0 module is reserved for external mode communication and cannot be used by the SCI Read block.
Data type— Data type of data from the UART port
Data type of data to be read from the UART port.
Data length (N)— Number of data points to be read from the UART port
1(default) | Any integer greater than or equal to 0
Number of data points to be read from the UART port for the selected data type.
Output status— Status of read operation
Select this parameter to enable the Status port.
Sample time— Frequency at which to read data from the UART port
Frequency at which to read data from the UART port, specified
in seconds. When you set this parameter to
Simulink determines the best sample time for the block based on the
block context within the model.