Main Content

Serial Transmit

Send serial data to UART or USART port

Add-On Required: This feature requires the UAV Toolbox Support Package for PX4 Autopilots add-on.

  • Serial Transmit block

Libraries:
UAV Toolbox Support Package for PX4 Autopilots / PX4 Utility Blocks

Description

The Serial Transmit block sends serial data to the Universal Asynchronous Receiver Transmitter (UART) port or the Universal Synchronous and Asynchronous Receiver Transmitter (USART) port on the PX4® flight controller.

The block accepts data as an N-by-1 or 1-by-N array and sends the same to the specified UART or USART port. The properties for each port for serial communication are mentioned in the Configuration Parameters dialog box in Simulink® (go to Configuration Parameters > Hardware Implementation > /dev/tty* pane).

During Connected I/O simulation, this block writes data to the specified serial port of the hardware.

The block inherits the data type from the signal at the input port.

Note

If you are using Cube Orange autopilot, then use GPS2 for serial data communication, as there might be issues using TELEM1 or TELEM2 ports.

Examples

Ports

Input

expand all

The port accepts values as an N-by-1 or 1-by-N array.

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

Parameters

expand all

Enter the name of the UART or USART port on the PX4 flight controller through which the block transmits the accepted data. To view the mapping between UART/USART ports and the labels on the Pixhawk flight controller, see Serial Port Names and Corresponding Labels on PX4 Flight Controller Boards.

Version History

Introduced in R2018b