User`s guide

Create Check for Model Configuration Parameters
25-19
</customcheck>
7
Verify the data syntax with Advisor.authoring.DataFile.validate. At the
command prompt, type:
dataFile = 'myDataFile.xml';
msg = Advisor.authoring.DataFile.validate(dataFile);
if isempty(msg)
disp('Data file passed the XSD schema validation.');
else
disp(msg);
end
Create Check for Diagnostics Pane Model Configuration Parameters
This example shows how to create a check for Diagnostics pane model configuration
parameters using a data file and an sl_customization file. The check uses the
ex_DataFile.xml data file created in “Create Data File for Diagnostics Pane
Configuration Parameter Check” on page 25-17. First, you register the check using an
sl_customization file. Using ex_DataFile.xml, the check warns when:
Algebraic loop is set to none
Minimize algebraic loop is not set to error
Block Priority Violation is not set to error
The check fix action modifies the Minimize algebraic loop and Block Priority
Violation settings to error.
1
Close the Model Advisor and your model if either are open.
2
Use the following sl_customization.m file to specify and register check Example:
Check model configuration parameters. The sl_customization.m files uses
Advisor.authoring.CustomCheck.checkCallback to define the check. It uses
Advisor.authoring.CustomCheck.actionCallback to set the fix action.
function sl_customization(cm)
% register custom checks.
cm.addModelAdvisorCheckFcn(@defineModelAdvisorChecks);
% register items to factory group.
cm.addModelAdvisorTaskFcn(@defineModelAdvisorGroups);
%% defineModelAdvisorChecks
function defineModelAdvisorChecks