Termination entry point in generated code for Simulink model
void model
_terminate(void)
The calling interface generated for this function also differs depending on the setting of model configuration parameter Code interface packaging:
C++ class
(default for
C++ language) — Generated function is encapsulated into a C++
class method. Required model data is encapsulated into C++ class attributes.
Nonreusable function
(default
for C language) — Generated function passes (void)
.
Model data structures are statically allocated, global, and accessed
directly in the model code.
Reusable function
—
Generated function passes the real-time model data structure, by reference,
as an input argument. The real-time model data structure is exported
with the
header
file.model
.h
For an ERT-based model, you can use model configuration parameter Pass root-level I/O as to control how root-level input and output arguments are passed to the function. They can be included in the real-time model data structure, passed as individual arguments, or passed as references to an input structure and an output structure.
The generated
function
contains the termination code for a Simulink® model and should
be called as part of system shutdown.model
_terminate
When
is
called, blocks that have a terminate function execute their terminate
code. If logging is enabled, model
_terminate
ends
data logging.model
_terminate
Calle the
function once.model
_terminate
For an ERT-based model, the code generator produces the
function for a
model when model configuration parameter Terminate function
required is selected (the default). If your application runs
indefinitely, you do not need the
model
_terminate
function. To suppress
the function, clear model configuration parameter Terminate function
required.model
_terminate