Main Content

Load Saved Parameters to Real-Time Application from Target Computer

To load a parameter set file of saved parameters to a real-time application, use the loadParamSet function.

By using the loadParamSet function you can load parameters to the same real-time application from which you save the parameter set file. If you attempt to load a parameter file to a different real-time application or to a real-time application that has changed since the parameter set was created, the load issues an error. This example uses the model slrt_ex_osc_outport. You must have a parameters file saved from an earlier run of saveParamSet to perform this procedure.

  1. To open this model, in the MATLAB Command Window, type:

    openExample('slrealtime/SlrtSaveCurrentSetOfRealTimeApplicatioParametersExample');
    open_system('slrt_ex_osc_outport');
  2. From the collection of parameter set files on the target computer, select the one that contains the parameter values to load. To get a list of available parameter set files, use the listParamSet function.

  3. In the Command Window, type:

    % load real-time application 
    model = 'slrt_ex_osc_outport';
    tg = slrealtime('TargetPC1');
    load(tg,model);
    
    % load parameter set file
    paramSetName = 'outportTypes';
    loadParamSet(tg,paramSetName); 
  4. The Simulink® Real-Time™ software loads the parameter values into the real-time application. For an example that shows how to get the parameter values from a ParameterSet object and use the object in the loadParamSet function, see loadParamSet.

For more information, see Save and Reload Parameters by Using the MATLAB Language.