Main Content

slreportgen.report.SystemIO class

Package: slreportgen.report

Simulink system input and output signal reporter

Description

Create a reporter that reports on signals entering or leaving a Simulink® model or subsystem.

Note

To use a SystemIO reporter in a report, you must create the report using the slreportgen.report.Report class.

The slreportgen.report.SystemIO class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

slreportgen.report.SystemIO() creates an empty slreportgen.report.SystemIO reporter object. Use the Object property to specify the model or subsystem to be reported. By default, the reporter generates summary tables for the system inputs and outputs. The input summary table lists the sources of the input signals. The output summary table lists the destinations of the output signals. The reporter also generates a signal details section that lists the properties of the input and output ports. Use the reporter properties to customize the content and appearance of the generated report. For example, use the DetailsReporter property to customize the content and appearance of the signal details section.

example

slreportgen.report.SystemIO(object) creates a reporter for the model or subsystem specified by object. See the Object property.

slreportgen.report.SystemIO(Name,Value) sets the reporter properties using name-value pairs. You can specify multiple name-value pair arguments in any order. Enclose each property name in single or double quotes.

Properties

expand all

Simulink model or subsystem to be reported, specified as a string scalar or character vector that contains the path to the model or subsystem, as a handle to the model or subsystem, as an slreportgen.finder.DiagramResult object, or as an slreportgen.finder.BlockResult object.

List of properties to report for each input, specified as a string array or a cell array of character vectors. You can include these properties in the list:

  • "Source"

  • "Name"

  • "DataType"

  • "Complexity"

  • "Dimensions"

  • "Min"

  • "Max"

  • "SampleTime"

  • "Units"

  • Any valid property of a Simulink port

By default, the list includes Source, Name, and DataType.

List of properties to report for each output, specified as a string array or a cell array of character vectors. You can include these properties in the list:

  • "Destination"

  • "Name"

  • "DataType"

  • "Complexity"

  • "Dimensions"

  • "Min"

  • "Max"

  • "SampleTime"

  • "Units"

  • Any valid property of a Simulink port

By default, the list includes Destination, Name, and DataType.

Whether to show a table that summarizes the inputs to the subsystem or model, specified as true or false.

Whether to show a table that summarizes the outputs from the subsystem or model, specified as true or false.

Whether to show details for each input or output, specified as true or false. If ShowDetails is true, the reporter inserts slreportgen.report.SimulinkObjectProperties reporters after the input and output summary tables. If Object is a model, details about the input or output blocks are included. If Object is a subsystem, details about the input or output ports are included. The port numbers in the summary tables link to the corresponding SimulinkObjectProperties reporter for that port.

Whether to show empty columns in summary tables, specified as true or false. If ShowEmptyColumns is true, the summary tables include columns that do not have data.

Table formatter for input summary tables, specified as an mlreportgen.report.BaseTable reporter. The default value is a BaseTable reporter. To customize the appearance of the table, modify the properties of the default table reporter or replace it with a customized table reporter. If you add content to the Title property of the default or customized table reporter, the content appears in front of the table title in the generated report.

Table formatter for output summary tables, specified as an mlreportgen.report.BaseTable reporter. The default value is a BaseTable reporter. To customize the appearance of the table, modify the properties of the default table reporter or replace it with a customized table reporter. If you add content to the Title property of the default or customized table reporter, the content appears in front of the table title in the generated report.

Formatter for detail tables, specified as an slreportgen.report.SimulinkObjectProperties reporter. The default value is an SimulinkObjectProperties reporter. To customize the appearance of the detail tables, modify the properties of the default SimulinkObjectProperties reporter or replace it with a customized SimulinkObjectProperties reporter.

List formatter for the source and destination lists, specified as an mlreportgen.dom.UnorderedList or mlreportgen.dom.OrderedList object. The source list is the list of blocks to which an input signal is connected. The destination list is the list of blocks to which an output signal is connected. The default formatter is an UnorderedList object. To customize the appearance of the list, modify the properties of the default list formatter or replace it with a customized list object that does not contain any children.

Source of the template for this reporter, specified in one of these ways:

  • Character vector or string scalar that specifies the path of the file that contains the template for this reporter

  • Reporter or report whose template is used for this reporter or whose template library contains the template for this reporter

  • DOM document or document part whose template is used for this reporter or whose template library contains the template for this reporter

The specified template must be the same type as the report to which this reporter is appended. For example, for a Microsoft® Word report, TemplateSrc must be a Word reporter template. If the TemplateSrc property is empty, this reporter uses the default reporter template for the output type of the report.

Name of the template for this reporter, specified as a character vector or string scalar. The template for this reporter must be in the template library of the template source (TemplateSrc) for this reporter.

Hyperlink target for this reporter, specified as a character vector or string scalar that specifies the link target ID, or an mlreportgen.dom.LinkTarget object. A character vector or string scalar value is converted to a LinkTarget object. The link target immediately precedes the content of this reporter in the output report.

Methods

expand all

Examples

collapse all

This example uses an slreportgen.report.SystemIO reporter to report on the inputs and outputs of a model and its subsystems.

model_name = "f14";
load_system(model_name);
% Create a Simulink report
rpt = slreportgen.report.Report("SystemIO_example","docx");

% Create finder to find all diagrams in model
finder = slreportgen.finder.DiagramFinder(model_name);

% Report inputs and outputs of each diagram
ch = mlreportgen.report.Chapter("Diagrams");
while hasNext(finder)
  result = next(finder);
  if strcmpi(result.Type,"Simulink.SubSystem") ...
          || strcmpi(result.Type,"Simulink.BlockDiagram")
      sect = mlreportgen.report.Section(result.Name);
      add(sect,result);
      % Create SystemIO reporter and add to report
      ioRptr = slreportgen.report.SystemIO(result);        
      add(sect,ioRptr);

      add(ch,sect);
  end
end

% Add chapter to report and close report
add(rpt,ch);
close(rpt);
rptview(rpt);

Tips

  • The input and output signal properties reported by the SystemIO reporter correspond to Simulink properties, which you can query by using get_param. For example, the DataType and Dimensions properties correspond to the Simulink CompiledPortDataType and CompiledPortDimensions properties of the port handles.

  • For bus signals, Simulink determines the values of the CompiledPortDataType and CompiledPortDimensions properties based on whether the signal is a nonvirtual or virtual bus.

Introduced in R2020a