Stateflow User's Guide Previous page   Next Page

Calling Graphical Functions from Custom Code

You specify custom C code for Stateflow targets as described in Specifying Custom Code Options for Stateflow Targets. Use the following procedure to call a graphical function from custom C code:

  1. Create the graphical function at the root level of the chart that defines the function (see Creating a Function).
  2. Export the function from the chart that defines the function (see Exporting Functions).
  1. This option implicitly forces the chart and function names to be preserved.

  1. Include the generated header file chart_name.h at the top of your custom code, where chart_name is the name of the chart that contains the graphical function.
  1. The chart header file contains the prototypes for the graphical functions that the chart defines.


Previous page  Including Custom C++ Code Starting the Build Next page

© 1994-2005 The MathWorks, Inc.