Execute contents on a model terminate event
Simulink / User-Defined Functions
The Terminate Function block is a pre-configured
subsystem block that executes on a model terminate event. By default,
the Terminate Function block includes an Event
Listener block with Event set to
a Terminator block, and a State Reader block.
Replace the Terminator block with blocks to save the state value from the State Reader block.
Conditionally executed subsystem blocks with output ports are fully supported within Terminate Function blocks.
For a list of unsupported blocks and features, see Initialize, Reset, and Terminate Function Limitations.
The input and output ports of a component containing Initialize Function and Terminate Function blocks must connect to input and output port blocks.
The code generated from this block is part of the
that is called once at the end of model execution.
You can select an Initialize Function, Reset Function, or Terminate Function block or a corresponding state owner block to highlight blocks related to it.
Actual code generation support depends on block implementation.
Actual data type support depends on block implementation.