Main Content

State Loop

Run child components for all states in current context

Description

This component runs its children for all states in its context. The parent component of this component determines the context.

  • Model Loop: Includes all states in the models.

  • System Loop: Includes all states in the systems.

  • Machine Loop: Includes all states in the machines.

  • Chart Loop: Includes all states in the charts.

  • State Loop: Includes all states in the current state.

For conditional processing based on states, you can use the RptgenSF.getReportedState function. For more information, see Loop Through Context Functions.

State Types

  • Include “and” and “or” states: Includes AND and OR states in the loop.

  • Include “box” states: Includes “box” states in the loop.

  • Include functions: Includes “function” states in the loop.

  • Include truth tables: Includes truth tables in the loop.

  • Include MATLAB functions: Includes MATLAB® functions in the loop.

Loop Options

  • Report depth: Specifies the level on which to loop.

    • Local children only

    • All objects

  • Skip autogenerated charts under truth table: Keeps autogenerated state objects under truth tables from appearing in the report.

  • Search Stateflow: Indicates specific states to include in the loop.

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.

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

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_sf.csf_state_loop