Main Content

Advisor.authoring.generateConfigurationParameterDataFile

Namespace: Advisor.authoring

Generate XML data file for custom configuration parameter check

Description

Advisor.authoring.generateConfigurationParameterDataFile(dataFile,source) generates an XML data file named dataFile specifying the configuration parameters for source. The data file uses tagging to specify the configuration parameter settings you want. When you create a check for configuration parameters, you use the data file. Each model configuration parameter specified in the data file is a subcheck.

example

Advisor.authoring.generateConfigurationParameterDataFile(dataFile,source,Name,Value) generates an XML data file named dataFile specifying the configuration parameters for source. It also specifies additional options by one or more optional Name,Value arguments. The data file uses tagging to specify the configuration parameter settings you want. When you create a check for configuration parameters, you use the data file. Each model configuration parameter specified in the data file is a subcheck.

example

Examples

collapse all

Create a data file with all the configuration parameters. You use the data file to create a configuration parameter.

Open the model vdp by entering:

openExample('simulink_general/VanDerPolOscillatorExample')

model = 'vdp';
dataFile = 'myDataFile.xml';
Advisor.authoring.generateConfigurationParameterDataFile( ...
               dataFile, model);

Data file myDataFile.xml has tagging specifying subcheck information for each configuration parameter. myDataFile.xml specifies the configuration parameters settings you want. The following specifies XML tagging for configuration parameter AbsTol. If the configuration parameter is set to 1e-6, the configuration parameter subcheck specified in myDataFile.xml passes.

<!-- Absolute tolerance: (AbsTol)-->
  <PositiveModelParameterConstraint>
     <parameter>AbsTol</parameter>
     <value>1e-6</value>
     </PositiveModelParameterConstraint>

Create a data file with configuration parameters for the Solver pane. You use the data file to create a Solver pane configuration parameter check with fix actions.

Open the model vdp by entering:

openExample('simulink_general/VanDerPolOscillatorExample')

model = 'vdp';
dataFile = 'myDataFile.xml';
Advisor.authoring.generateConfigurationParameterDataFile( ...
               dataFile, model, 'Pane', 'Solver', 'FixValues', true);

Data file myDataFile.xml has tagging specifying subcheck information for each configuration parameter. myDataFile.xml specifies the configuration parameters settings that you want. The following specifies XML tagging for configuration parameter AbsTol. If the configuration parameter is set to 1e-6, the configuration parameter subcheck specified in myDataFile.xml passes. If the subcheck does not pass, the check fix action modifies the configuration parameter to 1e-6.

<!-- Absolute tolerance: (AbsTol)-->
  <PositiveModelParameterConstraint>
     <parameter>AbsTol</parameter>
     <value>1e-6</value>
     <fixvalue>1e-6</fixvalue>
     </PositiveModelParameterConstraint>

Input Arguments

collapse all

Name of XML data file to create, specified as a character vector.

Example: 'myDataFile.xml'

Name of model or Simulink.ConfigSet object used to specify configuration parameters

Example: 'vdp'

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'Pane', 'Solver', 'FixValues', true specifies a dataFile with Solver pane configuration parameters and fix tagging.

Option to limit the configuration parameters in the data file to the pane specified as the comma-separated pair of 'Pane' and one of the following:

  • Solver

  • Data Import/Export

  • Optimization

  • Diagnostics

  • Hardware Implementation

  • Model Referencing

  • Code Generation

Example: 'Pane','Solver' limits the dataFile to configuration parameters on the Solver pane.

Data Types: char

Setting FixValues to true provides the dataFile with fix tagging. When you generate a custom configuration parameter check using a dataFile with fix tagging, each configuration parameter subcheck has a fix action. Specified as the comma-separated pair of 'FixValues' and either true or false.

Example: 'FixValues,true specifies fix tagging in the dataFile.

Data Types: logical

Version History

Introduced in R2014a