Main Content

importParamSet

Create ParameterSet object

Since R2021a

    Description

    example

    parameter_set = importParamSet(target_object,filename,app_name) imports the parameters from the parameter set file on the target computer into a ParameterSet object on the 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.

    Examples

    collapse all

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

    mdlName = 'slrt_ex_osc_outport';
    slbuild(mdlName);
    tg = slrealtime('TargetPC1');
    connect(tg);
    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.

    mdlName = 'slrt_ex_osc_outport';
    slbuild(mdlName);
    tg = slrealtime('TargetPC1');
    connect(tg);
    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