Main Content

slreportgen.report.SystemIO Class

Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter

Simulink system input and output signal reporter

Since R2020a

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.

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

example

slreportgen.report.SystemIO(Name=Value) sets the reporter properties using name-value pairs. You can specify multiple name-value pair arguments in any order.

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.

Attributes:

GetAccess
public
SetAccess
public

List of properties to report for each input, specified as a string array or a cell array of character vectors. By default, the list includes Port, Inport Block, Source, Name, and DataType. The value reported for Inport Block is the name of the Inport block that corresponds to the input signal in the system. You can include these signal properties in the list:

  • "Port"

  • "Source"

  • "Name"

  • "Description"

  • "DataType"

  • "Complexity"

  • "Dimensions"

  • "Min"

  • "Max"

  • "SampleTime"

  • "Units"

You also can specify these block properties of the corresponding Inport block:

  • "Inport Block"

  • "Inport Block Description"

Attributes:

GetAccess
public
SetAccess
public

List of properties to report for each output, specified as a string array or a cell array of character vectors. By default, the list includes Port, Outport Block, Destination, Name, and DataType. The value reported for Outport Block is the name of the Outport block that corresponds to the output signal in the system. You can include these signal properties in the list:

  • "Port"

  • "Destination"

  • "Name"

  • "Description"

  • "DataType"

  • "Complexity"

  • "Dimensions"

  • "Min"

  • "Max"

  • "SampleTime"

  • "Units"

You also can specify these block properties of the corresponding Outport block:

  • "Outport Block"

  • "Outport Block Description"

Attributes:

GetAccess
public
SetAccess
public

Whether to show a table that summarizes the inputs to the subsystem or model, specified as true or false. The InputSummaryProperties property determines which input properties the table includes.

Attributes:

GetAccess
public
SetAccess
public

Whether to show a table that summarizes the outputs from the subsystem or model, specified as true or false. The OutputSummaryProperties property determines which output properties the table includes.

Attributes:

GetAccess
public
SetAccess
public

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.

Attributes:

GetAccess
public
SetAccess
public

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.

Attributes:

GetAccess
public
SetAccess
public

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.

Attributes:

GetAccess
public
SetAccess
public

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.

Attributes:

GetAccess
public
SetAccess
public

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.

Attributes:

GetAccess
public
SetAccess
public

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.

Attributes:

GetAccess
public
SetAccess
public

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 you append this report. 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 specified by the TemplateSrc property of this reporter.

Data Types: char | string

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 converts 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. Create SystemIO reporter and add to report.

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);
      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.

Version History

Introduced in R2020a

expand all