Main Content

updateStartupParameterSet

Update the startup parameter set for an application

Since R2021a

    Description

    updateStartupParameterSet(app_object,parameter_set) updates the selection of the startup parameter set for a real-time application from a parameter set file on the Speedgoat® target computer. After adding one or more ParameterSet objects to an application by using the addParamSet function, you can choose one of these parameter sets to be loaded when the startup real-time application is loaded on target computer startup. This selection only applies when you have selected a startup real-time application.

    Note

    The default parameter set and startup parameter set are different names for the same parameter set that Simulink® Real-Time™ loads when loading the real-time application. The different names denote different workflows for selecting the default or startup parameter sets and the location where the parameter set is stored.

    • By using the setDefaultParameSet function, you set the default parameter set selection in the real-time application MLDATX file on the target computer.

    • By using the updateStartupParameterSet function, you set the startup parameter set selection in the real-time application MLDATX file on the development computer.

    Note

    The startupParameterSet value is one of the Options for an Application object. By default, this value is unset. To clear the value, use the process shown in Get and Set Application Options.

    example

    Examples

    collapse all

    To update the startup parameter set for a real-time application from a ParameterSet object, use the updateStartupParameterSet function.

    % create and import a parameter set
    tg = slrealtime;
    mdlSTF = getSTFName(tg);
    mdlName = 'slrt_ex_osc_outport';
    openExample(mdlName);
    set_param(mdlName,"SystemTargetFile",mdlSTF);
    slbuild(mdlName);
    load(tg,mdlName);
    paramSetName = 'outportTypes';
    saveParamSet(tg,paramSetName);
    myParamSet = importParamSet(tg,paramSetName);
    
    % modify parameter set value in parameter set
    set(myParamSet,'slrt_ex_osc_outport/Signal Generator','Amplitude',10);
    
    % add parameter set into real-time application 
    % and set as startup parameter set
    myAppObj = slrealtime.Application(mdlName);
    addParamSet(myAppObj,myParamSet);
    updateStartupParameterSet(myAppObj,myParamSet)
    
    % load real-time application and 
    % check that modified parameter set is loaded
    load(tg,mdlName);
    getparam(tg,'slrt_ex_osc_outport/Signal Generator','Amplitude')
    ans =
    
         10

    Input Arguments

    collapse all

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

    The ParameterSet object that was created from the real-time application in the importParamSet command.

    Example: myParamSet

    Version History

    Introduced in R2021a