Main Content

importParamSet

Create ParameterSet object

Since R2021a

    Description

    parameter_set = importParamSet(target_object,filename,app_name) imports the parameters from the parameter set file on the Speedgoat® target computer into a ParameterSet object on the MATLAB® development computer. If the app_name is omitted, the currently loaded real-time application is used. When a real-time application stops, its parameter values are saved to parameter set file autoSaveOnStop. You can import this parameter set to the development computer and load it to the real-time application.

    example

    Examples

    collapse all

    Import the parameters from the parameter set file on the target computer into a ParameterSet object on the development computer.

    tg = slrealtime;
    mdlSTF = getSTFName(tg);
    mdlName = 'slrt_ex_osc_outport';
    openExample(mdlName);
    set_param(mdlName,"SystemTargetFile",mdlSTF);
    slbuild(mdlName);
    load(tg,mdlName);
    paramSetName = 'myParamSet';
    saveParamSet(tg,paramSetName);
    myParamSet = importParamSet(tg,paramSetName);

    Import the parameters from the autoSaveOnStop parameter set file on the target computer into a ParameterSet object on the development computer.

    tg = slrealtime;
    mdlSTF = getSTFName(tg);
    mdlName = 'slrt_ex_osc_outport';
    openExample(mdlName);
    set_param(mdlName,"SystemTargetFile",mdlSTF);
    slbuild(mdlName);
    load(tg,mdlName);
    paramSetName = 'myParamSet';
    saveParamSet(tg,paramSetName);
    start(tg);
    pause(3);
    % the pause provides for the app to run and stop
    myParamSet = importParamSet(tg,'autoSaveOnStop','slrt_ex_osc_outport');

    Input Arguments

    collapse all

    Provides access to methods that manipulate the target computer properties.

    Example: tg

    Enter the name of the parameter set file from the target computer file system.

    Example: 'outportTypes'

    Data Types: char | string

    Provides name of real-time application MLDATX file that you built from the model.

    Example: 'slrt_ex_osc'

    Output Arguments

    collapse all

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

    Example: myParamSet

    Version History

    Introduced in R2021a