Main Content

updateStartupParameterSet

Update the startup parameter set for an application

    Description

    example

    updateStartupParameterSet(app_object,filename) updates the selection of the startup parameter set for a real-time application from a parameter set file filename. After adding one or more ParameterSet objects to an application by using the addParamSet function, you can choose which of these parameter sets is loaded into the real-time application on startup by using the updateStartupParameterSet function.

    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
    mdlName = 'slrt_ex_osc_outport';
    slbuild(mdlName);
    tg = slrealtime('TargetPC1');
    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
    myApp = slrealtime.Application(mdlName);
    addParamset(myApp,myParamSet);
    updateStartupParameterSet(myApp,paramSetName);
    
    % 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.

    Enter the name of the parameter set file.

    Example: 'outportTypes'

    Data Types: char | string

    Introduced in R2021a