Main Content

ParameterTuner

Create parameter tuner component for App Designer component in instrument panel UI

Description

example

hPTuner = slrealtime.ui.tool.ParameterTuner(hFigure) creates a parameter tuner component for an App Designer component on an instrument panel uifigure figure. After connecting the parameter tuner to an App Designer component (such as a knob), the App Designer component gets or sets data in the real-time application in the same manner as Simulink Real-Time components available in the App Designer. The parameter tuner component pulls the current parameter value from the target when:

  • The instrument panel first starts and an application is loaded on the selected target computer.

  • The target selected by the instrument panel changes and an application is loaded on the selected target computer.

  • An application is loaded on the selected target computer.

  • The parameter is changed from an external source, such as the command line, Explorer, other instrument panels on the selected target computer.

If the current value of the parameter is changed from an external source and is invalid for the Parameter Tuning component (for example, it is out of range of the knob), the Parameter Tuning component displays a warning icon covering the component. Changing the parameter from an external source to some valid value for the component removes the warning icon.

For information about parameter tuner properties, see slrealtime.ui Properties.

Examples

collapse all

Create an App Designer component and connect it to a block in a real-time application for parameter tuning. Changing the value of the component pushes the value to the real-time application on the target computer.

% Create figure 
hFig = uifigure(); 
% Create a hKnob 
hKnob = uiknob(hFig); 
% Create Parameter Tuning object 
hParamTuner = slrealtime.ui.tool.ParameterTuner(hFig); 
hParamTuner.Component = hKnob; 
hParamTuner.BlockPath = 'testmodel/Constant6'; 
hParamTuner.ParameterName = 'Value';

Input Arguments

collapse all

The hFigure argument identifies the uifigure to which you are adding the UI component.

Example: hFig = uifigure()

Data Types: function_handle

Output Arguments

collapse all

The hPTuner argument is the handle to the parameter tuner component that you create for the App Designer component.

Introduced in R2021b