Package: cgv
Superclasses:
Check and modify model configuration parameter values
Creates a handle to a cgv.Config
object that
supports checking and optionally modifying models for compatibility
with various modes of execution that use generated code, such as,
Software-In-the-Loop (SIL) or Processor-In-the-Loop (PIL).
To execute the model in the mode that you specify, you might
need to make additional modifications to the configuration parameter
values or the model beyond those configured by the cgv.Config
object.
By default, cgv.Config
modifies configuration
parameter values to the values that it recommends, but does not save
the model. Alternatively, you can use cgv.Config
parameters
to modify the default specification. For more information, see the
properties, ReportOnly
and SaveModel
.
If you use cgv.Config
to modify a model, do
not use referenced configuration sets in that model. If a model uses
a referenced configuration set, update the model with a copy of the
configuration set, by using the Simulink.ConfigSetRef
.getRefConfigSet
method.
If you use cgv.Config
on a model that executes
a callback function, the callback function might modify configuration
parameter values each time the model loads. The callback function
might revert changes that cgv.Config
made. If this
change occurs, the model might not be set up for SIL or PIL. For more
information, see Callbacks for Customized Model Behavior.
creates
a handle to a cfgObj
= cgv.Config(model_name
)cgv.Config
object, cfgObj
,
using default values for properties. model_name
is
the name of the model that you are checking and optionally configuring.
constructs the object using options,
specified as parameter name and value pairs. Parameter names and values
are not case sensitive.cfgObj
= cgv.Config(model_name
, Name,
Value
)
Name
can also be a property name and Value
is
the corresponding value. Name
must appear inside
single quotes (''
). You can specify several name-value
pair arguments in a variety of orders, such as Name1,Value1,…,NameN,ValueN
.
|
Specify whether to compile the model and check that the model
outports configuration is compatible with the
| ||||||||
|
Define the SIL or PIL approach If mode of execution is simulation (
| ||||||||
|
Specify mode of execution
| ||||||||
|
Specify the Signal logging and Output parameters on the Data Import/Export pane of the Configuration Parameters dialog box.
| ||||||||
|
The If you set
| ||||||||
|
Specify whether to save the model with the configuration parameter
values recommended by If you set
|
configModel | Determine and change configuration parameter values |
displayReport | Display results of comparing configuration parameter values |
getReportData | Return results of comparing configuration parameter values |
Handle. To learn how handle classes change copy operations, see Copying Objects in the MATLAB Programming Fundamentals documentation.
Configure the rtwdemo_iec61508
model for top-model SIL. Then view the
changes at the MATLAB Command
Window:
% Create a cgv.Config object and configure the model for top-model SIL. load_system('rtwdemo_iec61508'); set_param('rtwdemo_iec61508', 'SaveFormat', 'StructureWithTime'); cgvCfg = cgv.Config('rtwdemo_iec61508', 'LogMode', 'SaveOutput', ... 'connectivity', 'sil'); cgvCfg.configModel(); % Display the results of what the cgv.Config object changed. cgvCfg.displayReport(); % Close the rtwdemo_iec61508 model. bdclose('rtwdemo_iec61508');