Find System and Software Architecture Guideline Errors as You Edit
Improve the consistency, clarity, and readability of your model-based systems engineering (MBSE) projects by using edit-time checks in System Composer™ to catch issues while you are editing. Create your own custom edit-time checks in Simulink Check™ to fix issues as you design your system architecture.
Leverage the custom checks across architectures and projects to ensure consistent models throughout your organization. Improve conformance to modeling guidelines, catch mistakes early in the design, and fix common issues with a single button.
Custom checks are created as subclasses of ModelAdvisor.EdittimeCheck
and registered with the Model Advisor, meaning they are independent of architecture models and can easily be deployed across multiple projects and shared within your organization. Use the Model Advisor Configuration Editor to create a .json file and add it to the model configuration parameters to include them in your architecture.
Published: 19 Oct 2022
You can use edit time checks with System Composer to ensure conformance to your modeling guidelines and fix issues in real time as you're editing. Create your own custom edit time checks and use them across architectures and projects to ensure consistent models throughout your organization. The example that follows can be found in the documentation page linked below.
Three checks will be implemented in this video. The first one, to ensure component names are not too long. The second one, to ensure connector ports have matching interfaces. And the third one, to flag unconnected ports.
To create custom edit time checks, first create an sl_customization function that will register the custom edit time checks with the model advisor. Use the addModelAdvisorCheck function method just store the function handle that enumerates the custom checks, here called define check. This function specifies a check group and the checks within that group, including their titles and function handles.
The checks themselves are implemented as subclasses of ModelAdvisor.EdittimeCheck. And the constructor for this check, pick the block iteration traversalType to run only on newly added or edited components. The blockDiscovered method identifies which components violate the check.
The violation for this check triggers when a components name is longer than 18 characters. When working with systemcomposer, make changes directly on the architectural element by accessing its properties. Use the lookup method to get the element from its underlying SimulinkHandle, which is one of the inputs to the blockDiscovered method.
Optional fixed methods enable you to automate solutions to common checks by pressing a fixed button in the check dialog. In the same example, this fixed method truncates the component name to the first 18 characters. With the S cell customization file in the Matlab path, use the Advisor.Manager.refresh_customizations API to register the new checks and then open the model advisor configuration editor. There, select your custom checks and save the configuration entry.json file.
Finally, enable edit time checks in the model advisor tab of the model configuration parameters and select the .json file you have just created. This architecture for a guidance, navigation and control module of a CubeSat show how these checks work in practice. The split element is highlighted because it has a disconnected port.
Clicking on the Warning symbol above the element brings up more details for the check. There's no fixed method defined for this check, so it must be resolved manually. Then your connection is immediately highlighted because of an interface mismatch between the ports.
You can use the fixed button to copy the interface into the outport. Checks can also be justified for the whole model in the model advisor configuration editor or suppressed on a block by block basis by adding individual justifications. The last check alerts you that the name of the attitude control system element is too long. You can suppress the alert by clicking on the warning and specifying the reason for the exception.
The justifications will be shown in the model advisor after running the checks. Custom edit time checks allow you to identify and fix issues as you model your system's architecture. Learn more about custom edit time checks in System Composer by visiting the documentation page shown here and linked in this video's description.