主要内容

Serial Transmit

R2026b

Transmit data to an ArduPilot serial (SCI) port

Since R2026b

  • Serial Transmit block

Libraries:
UAV Toolbox Support Package for ArduPilot Autopilots / Peripheral Blocks

Description

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

The Serial Transmit block transmits data over a serial communication interface (SCI) on supported ArduPilot® targets. The block accepts input values as an N-by-1 or 1-by-N array.

Use this block to transmit data from a Simulink®model to external devices or subsystems over a serial connection on ArduPilot hardware. Typical applications include, transmitting sensor or control data to external serial peripherals, debug or telemetry data transmission, and communication with companion computers or serial devices.

The Serial Transmit block is supported only on ArduPilot based flight controllers. It is not supported for SITL board configuration or ArduPilot Host Target autopilot configuration.

Note

When you use this block to send serial data, set the SERIALx_PROTOCOL parameter of the ArduPilot autopilot to an unused protocol value. For instance, using Mission Planner, set the parameter to 55. When SERIALx_PROTOCOL has its default value, ArduPilot assigns a built-in driver to the port and the serial block cannot access it.

Examples

Ports

Input

expand all

The port accepts data to transmit through the selected serial port. Verify that the data type used to transmit the data matches the data type expected by the receiver.

Parameters

expand all

Select the serial port that the block uses to communicate between the target hardware and the external serial device. The available options depend on the serial port labels supported by the target hardware configuration. To verify the mapping between the logical port name and the physical port label, check the hardware board configuration set.

The selected serial port is supported only when you build and deploy the model to hardware. In Monitor & Tune(external mode) or Connected IO, the USB is reserved for communication between Simulink and the target hardware and cannot be used by this block.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: SerialPortLabel
Values: USB | TELEM1 | TELEM2 | TELEM3 | GPS1 | GPS2 | GPS | GPS MODULE | UART4 & I2CB
Data Types: string | char

When you select this parameter, the Serial logical port parameter becomes available.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: SelectLogicalPort
Values: off | on
Data Types: string | char

Select the logical serial port. The logical port name maps to a numeric SCI module. In Monitor & Tune(external mode) or Connected IO, the USB is reserved for communication between Simulink and the target hardware and cannot be used by this block.

Dependencies

To enable this parameter, select the Select logical serial port parameter.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: LogicalPortList
Values: Serial 0 (default) | Serial 1 | Serial 2 | Serial 3 | Serial 4 | Serial 5 | Serial 6 | Serial 7 | Serial 8
Data Types: string | char

Version History

Introduced in R2026b

See Also

Blocks