Model - Include model as block in another model

Library

Ports & Subsystems

Description

The Model block allows you to include a model as a block in another model. The Model block displays input ports and output ports corresponding to the included model's top-level input and output ports. This allows you to connect the included model to other blocks in the containing model. See Referencing a Model for more information.

A signal that connects to a Model block is functionally the same signal outside and inside the block, and is therefore subject to the restriction that a given signal can have at most one associated signal object. See Simulink.Signal and Multiple Signal Objects for more information.

Data Type Support

Determined by the root-level inputs and outputs of the model referenced by the Model block.

Parameters and Dialog Box

Model Name

Name of the model referenced by this block. This name must be a valid MATLAB identifier. The model must exist on the MATLAB path and the MATLAB path must contain no other model having the same name. See Creating a Model Reference for details.

Model arguments

Names of model arguments accepted by the model referenced by this block. See Using Model Arguments for details.

Model argument values (for this instance)

Values to be passed as model arguments to the model referenced by this block each time the model is invoked during a simulation. Enter the values in this field as a comma-separated list in the same order as the corresponding argument names appear in the Model arguments field. See Using Model Arguments for details.

Simulation mode

The simulation mode for the model referenced by this block.

Accelerator

Simulink software creates a MEX-file for the submodel, then executes the submodel by running the S-function.

Normal

Simulink software executes the submodel interpretively, as if the submodel were an atomic subsystem implemented directly within the parent model.

Processor-in-the-loop (PIL)

This feature requires Real-Time Workshop Embedded Coder software.

Simulink creates both a MEX-file and a model reference target for the submodel. The MEX-file executes the cross-compiled object code on the target processor (or equivalent instruction set simulator).

See Referenced Model Simulation Modes for details.

Navigating a Model Block

Model blocks behave differently from other blocks when double-clicked. This customized behavior provides the results most likely to be useful given the current status of the Model block, as follows:

To display the Block Parameters dialog box for a resolved Model block, choose Model Reference Parameters from the Context or Edit menu.

Model Blocks and Direct Feedthrough

When a Model block is part of a cycle, and the block is a direct feedthrough block, an algebraic loop can result. An algebraic loop in a model is not necessarily an error, but it may not give the expected results. See:

Direct Model Block Feedthrough Caused by Submodel Structure

A Model block may be a direct feedthrough block due to the structure of the referenced model. Where direct feedthrough results from submodel structure, and an unwanted algebraic loop results, you can:

Direct Model Block Feedthrough Caused by Model Configuration

ERT-based targets provide the option Configuration Parameters > Real-Time Workshop Pane > Interface > Single output/update function. This option controls whether generated code has separate output and update functions, or a combined output/update function. See:

When Single output/update function is enabled (the default) a Model block has a combined output/update function, which makes the block a direct feedthrough block for all inports regardless of the structure of the referenced model. Where an unwanted algebraic loop results, you can:

Characteristics

Direct Feedthrough

If Single output/update function is enabled (the default), a Model block is a direct feedthrough block regardless of the structure of the referenced model.

If Single output/update function is disabled, a Model block may or may not be a direct feedthrough block, depending on the structure of the referenced model.

Scalar Expansion

Depends on model referenced by this block.

Multidimensionalized

Yes

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS