Stateflow | ![]() ![]() |
To create a graphical function, do the following:
In this case, the scope of the function is the entire Stateflow machine, which encompasses all the charts in the model. See Exporting Graphical Functions for more information.
The new function appears as an unnamed object in the Stateflow Explorer.
where f
is the function's name, a
1, a
2, a
n are formal names for its arguments, and y
is the formal name for its return value. The following example shows a prototype for a graphical function named f1
that takes two arguments and returns a value.
The Scope field in the Explorer indicates the role of the corresponding argument or return value. Arguments have scope Input
. Return values have scope Output
. The number that appears in parentheses for the scope of each argument is the order in which the argument appears in the function's prototype. When a Stateflow action invokes a function, it passes arguments to the function in the same order.
![]() | Using Graphical Functions in Stateflow Charts | Calling Graphical Functions | ![]() |