Initialize, Reinitialize, Reset, and Terminate Function Limitations
Initialize Function, Reinitialize Function, Reset Function, and Terminate Function blocks do not support certain blocks, signals, and modeling patterns.
Unsupported Blocks and Signals
This table describes whether the Initialize Function, Reinitialize Function, Reset Function, and Terminate Function blocks support the given blocks and signals.
Block or Signal | Support |
---|---|
Model blocks | Not supported. |
Custom code blocks | Not supported. |
Stateflow® charts | Supported by only Reset Function blocks. |
Resettable Subsystem blocks | Not supported. |
Blocks with states, for example, Unit Delay blocks | Supported by only Reset Function blocks. |
Blocks with absolute time, for example, Clock blocks | Not supported. |
MATLAB System blocks | Not supported. |
MATLAB Function blocks | Initialize Function, Reinitialize Function, and Terminate Function blocks support only MATLAB Function blocks without persistent or global data. Reset Function blocks support MATLAB Function blocks with or without persistent or global data. |
Simulink Function blocks | Initialize Function, Reinitialize Function, Reset Function, and Terminate Function blocks can call Simulink Function blocks as long as the Simulink Function blocks do not have:
|
Variable-size signals | Not supported. |
Unsupported Modeling Patterns
This table describes requirements for model components that contain Initialize Function, Reinitialize Function, Reset Function, and Terminate Function blocks.
Modeling Pattern | Requirement |
---|---|
Nonvirtual blocks between Initialize Function block and root input port block | When a model contains an Initialize Function block that has an input port, the input port must connect to the root input port block without intervening nonvirtual blocks. Virtual blocks, such as Inport and From blocks, may intervene between the input port of the Initialize Function block and the root input port block. When a harness model simulates the initialization of a referenced model with an initialize port on a Model block, the input ports of the Model block may connect to nonvirtual blocks in the harness model. |
Nonvirtual blocks between Terminate Function block and root output port block | When a model contains a Terminate Function block that has an output port, the output port must connect to the root output port block without intervening nonvirtual blocks. Virtual blocks, such as Outport and Goto blocks, may intervene between the output port of the Terminate Function block and the root output port block. When a harness model simulates the termination of a referenced model with a terminate port on a Model block, the output ports of the Model block may connect to nonvirtual blocks in the harness model. |
Branched input signal in export-function model | In an export-function model, a signal from a root Inport block to an Initialize Function, Reinitialize Function, Reset Function, or Terminate Function block must not branch to a Simulink Function block. |
Branched input signal in a model that is not an export-function model | In a model that is not an export-function model, a signal from a root Inport block to an Initialize Function, Reinitialize Function, Reset Function, or Terminate Function block must not branch to any other block. |
For example, suppose you have a model that contains Initialize Function and Terminate Function blocks.
The Initialize Function block connects to a root Inport block. The Terminate Function block connects to a root Outport block. The signal from the root Inport block to the Initialize Function block does not branch to any other blocks.
A harness model can simulate the model behavior.
To simulate the initialization of the referenced model, a control signal connects to the initialize port of the Model block, which corresponds with the Initialize Function block in the referenced model.
To simulate the termination of the referenced model, a control signal connects to the terminate port of the Model block, which corresponds with the Terminate Function block in the referenced model.
To provide an environment for the referenced model, nonvirtual blocks in the harness model connect to the Model block input and output ports.
See Also
Initialize Function | Reinitialize Function | Reset Function | Terminate Function | Event Listener | State Reader | State Writer | Parameter Writer