User`s guide
Model Execution
6-23
The states structure has two sections: the first is for the continuous states;
the second is for the discrete states.
• Block Parameters Structure (
rtP) — The parameters structure contains all
block parameters that can be changed during execution (e.g., the parameter
of a Gain block).
• External Inputs Structure (
rtU) —The external inputs structure consists of
all root-level Inport block signals. Field names are determined by either the
block’s output signal name, when present, or by the Inport block’s name
when the output signal is left unlabeled.
• External Outputs Structure (
rtY) —The external outputs structure consists
of all root-level Outport blocks. Field names are determined by the root-level
Outport block names in your model.
• Real Work, Integer Work, and Pointer Work Structures (
rtRWork, rtIWork,
rtPWork) — Blocks may have a need for real, integer, or pointer work areas.
For example, the Memory block uses a real work element for each signal.
These areas are used to save internal states or similar information.
Embedded Model Functions
The embedded-C and Ada code targets generate the following functions:
•
model_intialize — Performs all model initialization and should be called
once before you start executing your model.
• If the Real-Time Workshop option “Single output/update function” is
selected, then you will see:
-
model_step(int_T tid) — Contains the “output” and “update” code for
all blocks in your model.
Otherwise you will see:
-
model_output(int_T tid) — Contains the “output” code for all blocks in
your model.
-
model_update(int_T tid) — This contains the “update” code for all
blocks in your model.
• If the Real-Time Workshop option “Terminate function required” is selected,
then you will see:
-
model_terminate — This contains all model “shutdown” code and should
be called as part of system shutdown.