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 checks. the configuration parameters dialog box opens and you select the check box for edit-time checks.
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 function.
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.
if you edit the model when edit-time checking is enabled, the model advisor checks out a simulink check™ license.
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.
add a justification for the violation 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:
sldemo_fuelsys
.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 > customize edit-time checks.
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 checks
option. the filtered list identifies the model advisor checks that are supported for edit-time checking.note
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