Atomic subcharts facilitate the reuse of states and subcharts as standalone objects. The restrictions in the following sections help you get the benefits described in Benefits of Using Atomic Subcharts.
To convert a state or subchart to an atomic subchart, access to objects not parented by the state or subchart must be one of the following:
Chart-level graphical functions
If the state or subchart accesses a chart-level graphical function, the chart must export that function. For more information, see Export Stateflow Functions for Reuse.
Do not export graphical functions from an atomic subchart that maps variables to variables at the main chart level with a different scope.
The state or subchart that you want to convert to an atomic subchart cannot refer to:
Local events that are outside the scope of that state or subchart
However, the state or subchart you want to convert can refer to input events.
The state or subchart that you want to convert to an atomic subchart cannot access local data where the First index property is nonzero. For the conversion process to work, the First index property of the local data must be zero, which is the default value.
The state or subchart that you want to convert to an atomic subchart cannot reside in a chart that uses machine-parented data with the following properties:
Imported or exported
Is 2-D or higher, or uses a fixed-point type
Machine-parented data with these properties prevent reuse of generated code and other code optimizations.
To convert a state or subchart to an atomic subchart, your chart must use strong data typing with Simulink inputs and outputs. To specify strong data typing:
Open the Chart properties dialog box.
Select Use Strong Data Typing with Simulink I/O.
Click OK to close the dialog box.
The state or subchart that you want to convert to an atomic subchart cannot have any supertransitions crossing the boundary.
You cannot use a masked library chart containing mask parameters as an atomic subchart.