Real-Time Workshop User's Guide | ![]() ![]() |
Parameter Tuning via model_pt.c
By enabling the TLC variable ParameterTuning
, you can generate a file containing data structures that enable a running program to access model parameters without use of external mode. The file is named model
_pt.c.
ParameterTuning
is disabled by default. To enable generation of model
_pt.c
, use a %assign
statement in your system target file.
%assign ParameterTuning = 1
Alternatively, you can append the following command to the System target file field on the Target configuration section of the Real-Time Workshop page.
-aParameterTuning
=1
model
_pt.c
contains two parameter mapping structures containing information required for parameter tuning:
BlockTuning
structure contains all the modifiable block parameters by block name and parameter name. VariableTuning
structure contains all the modifiable workspace variables that were specified in a Simulink parameter dialog box.The structure and content of the model
_pt.c
file are documented in matlabroot
/rtw/c/src/pt_readme.txt
. For example source code using the parameter tuning API, see matlabroot
/rtw/c/src/pt_print.c
.
![]() | Signal Monitoring via Block Outputs | Target Language Compiler API for Signals and Parameters | ![]() |