Hauptinhalt

Read Parameter

R2026b

Read parameter value from ArduPilot

Since R2026b

  • Read Parameter

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

Description

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

The Read Parameter block reads the value of a specified ArduPilot® parameter. The block outputs the parameter value as a scalar of data type single, 32-bit floating-point type with up to 24 bits of mantissa precision.

Use this block to read the ArduPilot parameter values (set via a GCS like QGroundControl or Mission Planner) for real-time monitoring and closed-loop tuning by feeding live parameter values directly into the Simulink model. Typical use cases include reading the current flight mode status to switch between controllers in Simulink, accessing parameter values such as P, I, and D gains for use within control algorithms, and retrieving RC trim values (for example, RC1_TRIM) via MAVLink. Specify the desired ArduPilot parameter name in the Parameter name field.

Verify that the parameter value configured in ArduPilot follows the limits defined in the official ArduPilot parameter reference documentation. The parameter value must lie within the specified minimum and maximum range; otherwise, the system may exhibit undefined behavior.

Examples

Ports

Output

expand all

The port outputs one of these values:

  • 0 — Successful read operation

  • 1 — Invalid parameter name, or the selected vehicle does not support the specified parameter

Data Types: uint8

This port outputs the value of the requested ArduPilot parameter.

Data Types: scalar

Parameters

expand all

Specify the name of the ArduPilot parameter to read. To view the complete list of the parameters that control vehicle behavior, click View ArduPilot Parameters in the block parameters, or see Complete Parameter List in the ArduPilot documentation.

Programmatic Use

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

Parameter: ParameterName
Values: RC1_TRIM (default) | Valid ArduPilot parameter name
Data Types: char | string

When you specify -1, Simulink® determines the best sample time based on the block context within the model.

Programmatic Use

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

Parameter: SampleTime
Values: -1 (default)
Data Types: double

Version History

Introduced in R2026b

See Also

Blocks