Simulink® provides diagnostic messages when certain conditions are detected during a Simulink operation on a model. The diagnostic messages are captured under error, information, or warning categories.
The diagnostic messages you encounter in programmatic operations are displayed in the MATLAB® Command Window, while those you encounter during a Simulink user interface operation are displayed in the Diagnostic Viewer. For example, if you simulate a model from the MATLAB command prompt using the
sim function, the diagnostics messages are displayed in the Command Window. However, if you run a simulation from the Simulink Toolstrip, the diagnostic messages are displayed in the Diagnostic Viewer.
You can customize the diagnostic messages, and also customize the conditions the software checks to either produce errors or warnings.
The diagnostics for model are displayed in the Diagnostic Viewer user interface. To know more about the diagnostic viewer, see the topic View Diagnostics.
You can also add Model Verification blocks to your model, to check the condition of specific signals. For more information about Model Verification, see topics listed under Run Model Advisor Checks.
|Display diagnostic information about Simulink system|
|Restore diagnostic warnings to a specific block, subsystem, or model|
|Suppress a diagnostic from a specific block|
| Return |
|Return model checksum|
|Return checksum of nonvirtual subsystem|
|Open Model Advisor|
|Start simulation debugging session for Simulink model|
|Add terminators to unconnected ports in model|
|Create a stage to display diagnostic messages|
|Report error messages in Diagnostic Viewer|
|Report information messages in Diagnostic Viewer|
|Report warning messages in Diagnostic Viewer|
|Log simulation warnings and errors and build information to file|
|Display errors and warnings in |
|Suppress diagnostic messages from a specified block|
|Generate, display, and log diagnostic messages in the Diagnostic Viewer|
Paramètres du modèle
- View Diagnostics
View and diagnose errors and warnings with the Diagnostic Viewer.
- Systematic Diagnosis of Errors and Warnings
Identify and locate errors and warnings systematically.
- Report Diagnostic Messages Programmatically
sldiagviewerfunctions to generate, display, and log diagnostic messages.
- Suppress Diagnostic Messages Programmatically
Suppress and restore diagnostic messages programmatically.
- Customize Diagnostic Messages
Customize error messages to display text and hyperlink.
- Error Handling in Simulink Using MSLException
Simulink allows you to report an error by throwing an exception using the
MSLExceptionobject, which is a subclass of the MATLAB