What Is an Atomic Subchart?

In a Stateflow® chart, an atomic subchart is a graphical object that helps you reuse the same state or subchart across multiple charts and models. Atomic subcharts allow:

  • Ease of team development for people working on different parts of the same chart

  • Faster simulation after making small changes to a chart with many states or levels of hierarchy

  • Manual inspection of generated code for a specific state or subchart in a chart

  • Ability to animate and debug multiple charts side by side

States, subcharts, and atomic subcharts have these key similarities and differences:

CapabilityStateSubchartAtomic Subchart
Can behave as a standalone chartNoNoYes
Can generate reusable codeNoNoYes
Supports access to event broadcasts outside the scope of that objectYesYesNo
Supports access to data at any level of the hierarchyYesYesNo

Atomic subcharts and atomic subsystems (see Atomic Subsystem in the Simulink® documentation) have these key similarities and differences:

CapabilityAtomic SubchartAtomic Subsystem
Supports generation of reusable codeYesYes
Supports usage as a library linkYesYes
Requires parameterizing of data when used as a library linkYesNo
Supports explicit specification of sample timeNoYes

The following examples show how to use atomic subcharts for modeling typical applications:

ExampleApplication
sf_atomic_sensor_pairsf_atomic_sensor_pairA redundant sensor pair
sf_elevatorsf_elevatorAn elevator system with two identical lifts

Was this topic helpful?