Custom Code in Subsystems
The location of a Custom Code block
in your model determines the location of the code it contains. You
can use System Custom Code blocks either
at root level or within atomic subsystems; the code is local to the
subsystem in which you place the blocks. For example, the System
Outputs block places code in mdlOutputs when
the code block resides in the root model. If the System
Outputs block resides in a triggered or enabled subsystem,
however, the code is placed in the subsystem's Outputs function.
The ordering for a triggered or enabled system is
Output entry
Output exit
Update entry
Update exit
Note
If a root model or atomic subsystem does not need
to generate a function for which a Custom Code block
has been supplied, either the code in the block is not used or an
error is generated. There is no diagnostic setting to control this.
To eliminate the error, remove the Custom Code block. |
 | Example: Using a Custom Code Block | | Preventing User Source Code from Being Deleted from
Build Directories |  |
Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
Get this Simulink Kit