Main Content

PX4 Write Parameter

R2026b

Write PX4 system parameters

Since R2025a

  • PX4 Write Parameter Simulink block

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

Description

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

The PX4 Write Parameter block writes a value to a named PX4 system parameter from a Simulink model. To use the block, select a parameter name in the Parameter Name list, connect a signal of the matching data type to the Data input port, and run the simulation.

The block supports the parameters listed in PX4 Parameter Reference. You can also use your own custom parameters that align with the PX4 guidelines. For more information, see PX4 guidelines.

During Connected I/O simulation, this block writes parameter values directly to the flight controller hardware.

Examples

Ports

Input

expand all

Parameter value to write, specified as a scalar. The data type of the connected signal must match the Data Type parameter (int32 or float).

Data Types: int32 | float

Parameters

expand all

Select the required PX4 system parameter from the list. The Parameter Name parameter you select from this list must be one of the PX4 parameters; otherwise, the Status port outputs a value of 1, indicating that the parameter handle is invalid. Additionally, the block does not support parameters requiring a system reboot.

The block automatically populates the data type based on the parameter you selected in the Parameter Name list.

Note

If the Data Type parameter that you select does not match the actual data type of the PX4 parameter, the written values might lead to a data type mismatch.

If you select the Output Status parameter, the block configures an output port. A value of 0 indicates that the parameter name is valid and the write succeeded. A value of 1 indicates that the block did not find the parameter name.

Version History

Introduced in R2025a