Save Current Set of Real-Time Application Parameters to Target Computer
To save a set of parameters from a real-time application to a parameter set file, use the saveParamSet function. The real-time application can be loaded or running.
Connect Default Target Computer
tg = slrealtime; connect(tg);
Open Example Model and configure STF Selection
This example uses the model slrt_ex_osc_outport. To open this model, in the MATLAB Command Window, type:
model = 'slrt_ex_osc_outport'; open_system(model); modelSTF = getSTFName(tg); set_param(model,"SystemTargetFile",modelSTF);
Build Real-Time App
Use evalc to suppress build messages.
evalc('slbuild(model)');
Load Real-Time App
load(tg,model);
Save the Parameter Set
Select a descriptive file name for the parameters. For example, use the model name in the file name. To save the parameter set to a file on the target computer, in the MATLAB Command Window, type:
paramSetName = 'outportTypes';
saveParamSet(tg,paramSetName);
The Simulink® Real-Time™ software creates a parameter set file named outportTypes
on the target computer.
Close the Model
bdclose(model);