Stateflow | ![]() ![]() |
You can export a chart's root-level graphical functions to the chart's model. Exporting a chart's functions extends their scope to include all other charts in the same model.
You can also export graphical functions in library charts to a model as long as the library charts are present in the model. To export a chart's root-level functions, select Export Chart Level Functions on the chart's Chart Properties dialog box (see Specifying Chart Properties).
In the following example, the model main_model
has two library stateflow charts, lib1Chart
and lib2Chart
:
Both lib1Chart
and lib2Chart
were dragged into the model main_model
from the library models lib1
and lib2
in which they were created. In the properties dialog for all three charts, the Export Chart Level Functions option is selected. Each chart now defines a graphical function that can be called by any other chart placed in main_model
.
The sequence of action in simulation of main_model
is as follows:
modChart
calls the graphical function lib1_func
, with the two arguments, x
and y
.
lib1_func
calls the graphical function lib2_func
, passing the same two arguments.
lib2_func
calls the graphical function mod_func
, which adds x
and y
.
x
.
![]() | Calling Graphical Functions | Specifying Graphical Function Properties | ![]() |