Note: In order to use the UART Tx block in a Simulink® model, it is necessary to first include and set up the UART Configuration block .
The UART Tx block sends one byte or a vector of uint8 bytes through the UART. Transmitted characters might be buffered depending on the UART configuration. The UART Ref selected must be configured using a UART Configuration block. Multiple instances of this block can be used in one Simulink model.
The number of bytes to be sent can be specified by a block input parameter by enabling the option Send first N bytes from the vector input with N a block input from the Block Input tab.
Also, the transmission of the characters contained in the input vector can be stopped when the first occurrence of the NUL('\0') character is detected by enabling With vector input, do not send values following the first 0.
The number of bytes transmitted can be set as an output parameter by enabling Number of byte sent is a block output from the Block Output tab.
UART Tx example:
The following example will print "Hello World!" on the UART. Visit the "UART Terminal Example" page for a complete UART example.