Check Model Compliance Using Edit-Time Checking
When you enable edit-time checks, the Model Advisor evaluates the model against a subset of Model Advisor checks. Highlighted blocks in the model editor window alert you to issues in your model. This enables you to identify modeling issues earlier in the model design process.
Configure Your Model to Use Edit-Time Checking
You can use one of these methods to enable edit-time checking of your model:
In the Debug tab, select Diagnostics > Edit-Time Errors and Warnings.
In the Modeling tab, select Model Advisor > Edit-Time Checks. The Configuration Parameters dialog box opens and you select the check box for Edit-Time Checks.
Enable edit-time checking through the command line using the
If you have an Embedded Coder® or Simulink® Coder™ license, you can use edit-time checks to evaluate your model for issues that are specific to code generation. To enable these checks, open the Embedded Coder (Embedded Coder) app and select the C/C++ Code Advisor > Edit-Time Checks. The Configuration Parameters dialog box opens and you select the check box for Edit-Time Checks.
When edit-time checking is enabled, the Model Advisor highlights blocks in your model that violate Model Advisor checks.
To review a check violation, click the error or warning icon above the highlighted block. A diagnostics window opens, which provides information about the modeling issue that violates the Model Advisor check. When a block violates multiple checks, you can use the diagnostics window to review issues.
For each modeling issue, you can use the diagnostics window to:
Review the cause and explore suggested options for fixing the issue, if any.
Click the question mark to access detailed documentation about the violated Model Advisor check.
Ignore the warning and add the block to the exclusion list for that check by clicking Suppress.
In this example, you use edit-time checking to verify the compliance of a model with MAB guidelines while you edit.
Open a model. For this example, at the command prompt, type:
To enable the edit-time checking, in the Modeling tab, select Model Advisor > Edit-Time Checks. The Configuration Parameters dialog box opens and you select the check box for Edit-Time Checks.
The Model Advisor highlights several blocks. Place your cursor over the warning of the Throttle Angle Fault Switch block to discover the issue.
Select the warning. The Model Advisor indicates that the block name has an incorrect character. Replace the space with an underscore character and the warning goes away.
View and Customize the Edit-Time Checks in a Model Advisor Configuration
The Model Advisor checks that are available for edit-time checking are specified by using a Model Advisor configuration file. You use the Model Advisor Configuration Editor to review and modify existing configuration files and create new configuration files.
To open a Model Advisor configuration file and review the Model Advisor checks that are enabled for use in edit-time checking:
In the Simulink editor, click the Modeling tab and select Model Advisor > Configuration Editor.
The Model Advisor Configuration Editor opens. The file name for the configuration that is currently being used by the Model Advisor is displayed at the top of the window. Verify that you are evaluating the correct configuration file. To open a different configuration file, click Open and browse to the file you would like to review.
In the Model Advisor Configuration Editor, on the Model Advisor tab, select the
Edit time supported checksoption. The filtered list identifies the Model Advisor checks that are supported for edit-time checking.
When a check is included in multiple folders of your Model Advisor hierarchy, for edit-time checking, the Model Advisor prioritizes the check in your custom folder. If the check is not in your custom folder, priority goes to the check in the By Task folder, and finally to the check in your By Product folder.
In the Model Advisor tab, check the box beside the checks that you want to include in the edit-time check analysis. Deselect the boxes beside checks that you do not want analyzed. For additional information about using the Model Advisor Configuration Editor to create a custom Model Advisor configuration, including the customization of edit-time checks, see Use the Model Advisor Configuration Editor to Customize the Model Advisor