Main Content

sldiagviewer.createStage

Create stage to display diagnostic messages

Description

myStage = sldiagviewer.createStage(StageName,ModelName=ModelNameValue) creates a stage object with the name StageName. The argument ModelNameValue specifies the model name in which the diagnostics is run. When you load, simulate, or build a Simulink® model, the Diagnostic Viewer displays errors, warnings, and information messages in groups called stages. Each stage includes all the diagnostics of a single operation. Each successive operation generates a new stage.

  • To initialize a stage, create a stage object.

  • To end a stage, close the stage object.

  • If you create a new stage object without ending the current stage, the new stage is a child stage of the current stage.

  • If you delete a parent stage object, the parent and its child stages close in the Diagnostic Viewer.

example

Examples

collapse all

Create a stage to display diagnostic messages in the Diagnostic Viewer using sldiagviewer.createStage.

Load the model DiagnosticDemo.

model = "DiagnosticDemo";
load_system(model);

Create a stage to display the diagnostic messages.

myStage = sldiagviewer.createStage("Analysis","ModelName",model);

After you create the stage, you can report the diagnostics of your next Simulink® operation in the Diagnostic Viewer in the Analysis stage. For more information, see Diagnostic Viewer.

Input Arguments

collapse all

Name of the stage, specified as a character vector or string.

Example: "Analysis"

Data Types: char | string

Name or handle of the model, specified as a character vector or string.

Example: "DiagnosticDemo"

Data Types: char | string

Output Arguments

collapse all

Handle of the created stage, returned as a stage object.

Version History

Introduced in R2014a