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 which of these parameter sets is loaded into the real-time application on startup by using the updateStartupParameterSet function.

    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