Main Content

System Loop

Specify systems and subsystems on which to loop, as defined by parent component

Description

This component runs its child components for each system defined by the parent component. For example, to include systems and subsystems within a given model in the report, you can include this component as the child of a Model Loop component.

For conditional processing systems, you can use the RptgenSL.getReportedSystem function. For more information, see Loop Through Context Functions.

Report On

  • Loop on Systems:

    • Select systems automatically: Reports on all systems in the current context as set by the parent component.

      • Model Loop: Reports on systems in the current model.

      • System Loop: Reports on the current system.

      • Signal Loop: Reports on the parent system of the current signal.

      • Block Loop: Reports on the parent system of the current block.

      If this component does not have any of these components as its parent, selecting this option reports on all systems in all models.

      Note

      When selecting systems automatically, the system loop reports each instance of a referenced subsystem as a separate subsystem.

  • Custom - use system list: Reports on a list of specified systems. Specify the full path of each system.

  • %<VariableName>: Inserts the value of a variable from the MATLAB® workspace. The %<> notation can denote a string or cell array. For more information, see %<VariableName> Notation on the Text component reference page.

  • Include subsystems in Simulink functions: Specifies whether to include subsystems in Simulink® functions. By default, this option is enabled.

  • Include all variants: Report on all variant subsystems. By default, this option is disabled, which means only active subsystems are reported.

Loop Options

  • Sort Systems: Specifies how to sort systems.

    • Alphabetically by system name (default): Sorts systems alphabetically by name.

    • By number of blocks in system: Sorts systems by number of blocks. The list shows systems by decreasing number of blocks; that is, the system with the largest number of blocks appears first in the list.

    • By system depth: Sorts systems by their depth in the model.

    • By traversal order: Sorts systems in traversal order.

  • Search for: Reports only on the Simulink blocks with the specified property name-value pairs. To enable searching, click the check box. In the first row of the property name and property value table, click inside the edit box, delete the existing text, and type the property name and value.

    To find property names for blocks, use the get_param function or select a block in the model and enter this code at the MATLAB command line:

    get(gcbh)

Section Options

  • Create section for each object in loop: Inserts a section in the generated report for each object found in the loop.

  • Display the object type in the section title: Inserts the object type automatically into the section title in the generated report.

  • Number sections by system hierarchy: Hierarchically numbers sections in the generated report. Requires that Sort Systems be set to By traversal order.

  • Create link anchor for each object in loop: Create a link target for each system in the loop so that other parts of the report can link to it. For example, the image created by a System Snapshot component can link to the subsystem section only if you select this check box.

Examples

For an example of how to use this component with a Model Loop as its parent, see Model Loop.

Insert Anything into Report?

Yes, inserts a section if you select Create section for each object in loop and a link target if you select Create link anchor for each object in loop.

Class

rptgen_sl.csl_sys_loop