Main Content

getParameters

Get real-time application parameters

Since R2020b

Description

example

params_struct = getParameters(app_object) gets the application Parameters values as structures in an array. Use the getParameters function to get tunable parameter information from the Application object.

Tip

Some application parameters are tunable only in external mode from a model connected to the real-time application. The array returned by the getParameters function provides the parameters that you can tune by using the Simulink® Real-Time™ API or by using the Simulink Real-Time Explorer.

Examples

collapse all

You can get real-time application parameters by using the getParameters function.

  1. Create an application object.

    my_app = slrealtime.Application('slrt_ex_param_tuning')
    my_app = 
    
      Application with properties:
    
        ApplicationName: 'slrt_ex_param_tuning'
              ModelName: 'slrt_ex_param_tuning'
               UserData: []
                Options: [1×1 slrealtime.internal.ApplicationOptions]
  2. Get the application Parameters values as structures in an array.

    my_params = getParameters(my_app)
    my_params = 
    
      1×7 struct array with fields:
    
        BlockPath
        BlockParameterName
  3. View application parameter values as array elements.

    my_params(1).BlockParameterName
    ans =
    
        'Gain'

Input Arguments

collapse all

Provides access to methods that manipulate the real-time application files.

Output Arguments

collapse all

The Parameters values are read-only. The structures in the array are:

  • BlockPath — block path of the parameter in the application

  • BlockParameterName — block parameter name in the application

Version History

Introduced in R2020b