Documentation

Simulink.restoreDiagnostic

Restore diagnostic warnings to a specific block, subsystem, or model

Syntax

Simulink.restoreDiagnostic(source)
Simulink.restoreDiagnostic(source, message_id)
Simulink.restoreDiagnostic(diagnostic)
Simulink.restoreDiagnostic(system, 'FindAll', 'on')

Description

example

Simulink.restoreDiagnostic(source) restores all suppressed diagnostics associated with the blocks specified by source.

example

Simulink.restoreDiagnostic(source, message_id) restores all instances of message_id on the blocks specified by source.

Simulink.restoreDiagnostic(diagnostic) restores the suppressed diagnostics associated with MSLDiagnostic object diagnostic.

example

Simulink.restoreDiagnostic(system, 'FindAll', 'on') restores all suppressed diagnostics associated with the system specified by system.

Examples

collapse all

Using the model from Suppress Diagnostic Messages Programmatically, restore all suppressed diagnostics on a specified block.

Create a cell array of message identifiers. Use the Simulink.suppressDiagnostic function to suppress these multiple diagnostics from the Constant block, one.

diags = {'SimulinkFixedPoint:util:fxpParameterPrecisionLoss',...
 'SimulinkFixedPoint:util:fxpParameterUnderflow'};
Simulink.suppressDiagnostic('Suppressor_CLI_Demo/one', diags);

Remove all suppressions and restore diagnostics to the block.

Simulink.restoreDiagnostic('Suppressor_CLI_Demo/one');

Using the model from Suppress Diagnostic Messages Programmatically, restore a suppressed diagnostic on a specified block.

Use the Simulink.suppressDiagnostic function to suppress the parameter precision loss warning thrown by the Constant block, one.

Simulink.suppressDiagnostic('Suppressor_CLI_Demo/one',...
 'SimulinkFixedPoint:util:fxpParameterPrecisionLoss');

Remove the suppression and restore diagnostics to the block.

Simulink.restoreDiagnostic('Suppressor_CLI_Demo/one',...
 'SimulinkFixedPoint:util:fxpParameterPrecisionLoss');

Using the model from Suppress Diagnostic Messages Programmatically, restore all suppressed diagnostics on the specified subsystem.

To restore all diagnostics from a system, use 'FindAll', 'on' to search within the system hierarchy. Specify the system or system handle within which to search.

Simulink.restoreDiagnostic('Suppressor_CLI_Demo/Convert',...
 'FindAll', 'On');

Input Arguments

collapse all

The source of the diagnostic, specified as a block path, block handle, cell array of block paths, or cell array of block handles.

To get the block path, use the gcb function.

To get the block handle, use the getSimulinkBlockHandle function.

Data Types: char | cell

Message identifier of the diagnostic, specified as a character vector or a cell array of character vectors. You can find the message identifier of warnings and errors thrown during simulation by accessing the ExecutionInfo property of the Simulink.SimulationMetadata object associated with a simulation. You can also use the lastwarn function.

Data Types: char | cell

The subsystem name, or handle, specified as a character vector.

Data Types: char

Diagnostic specified as an MSLDiagnostic object. Access the MSLDiagnostic object through the ExecutionInfo property of the Simulink.SimulationMetadata object.

Data Types: struct

Introduced in R2016b

Was this topic helpful?