Using Simulink | ![]() ![]() |
Create an input port for a subsystem or an external input.
Library
Description
Inports are the links from outside a system into the system.
Simulink assigns Inport block port numbers according to these rules:
You can specify the dimensions of the input to the Inport block , using the Port dimensions parameter or let Simulink determine it automatically by providing a value of -1 (the default).
The Sample time parameter is the rate at which the signal is coming into the system. The default (-1) causes the block to inherit its sample time from the block driving it. It may be appropriate to set this parameter for Inport blocks in the top-level system or in models where Inport blocks are driven by blocks whose sample time cannot be determined.
Inport Blocks in a Subsystem
Inport blocks in a subsystem represent inputs to the subsystem. A signal arriving at an input port on a Subsystem block flows out of the associated Inport block in that subsystem.
The Inport block associated with an input port on a Subsystem block is the block whose Port number parameter matches the relative position of the input port on the Subsystem block. For example, the Inport block whose Port number parameter is 1 gets its signal from the block connected to the top-most port on the Subsystem block.
If you renumber the Port number of an Inport block, the block becomes connected to a different input port, although the block continues to receive its signal from the same block outside the subsystem.
The Inport block name appears in the Subsystem block icon as a port label. To suppress display of the label, select the Inport block and choose Hide Name from the Format menu. Then, choose Update Diagram from the Edit menu.
Inport Blocks in a Top-Level System
Inport blocks in a top-level system have two uses: to supply external inputs from the workspace, which you can do by using either the Simulation Parameters dialog box or the sim
command, and to provide a means for analysis functions to perturb the model:
ut
argument of the sim
command (see sim
).linmod
and trim
analysis functions. Inport blocks define the points where inputs are injected into the system. For information about using Inport blocks with analysis commands, see Chapter 5.Data and Numeric Type Support
An inport accepts real- or complex-valued signals of any data type. The data type and numeric type of the output of an inport is the same as that of the corresponding input signal. You can specify the signal type and data type of an external (i.e., workspace) input to a root-level inport, using the inport's Signal type and Data type parameters.
The elements of a signal array connected to a root-level inport must be of the same numeric type and data type. Signal elements connected to a subsystem inport may be of differing numeric and data types except in one instance. If the subsystem contains an Enable or Trigger block and the inport is connected directly to an outport, the input elements must be of the same type. For example, consider the follow enabled subsystem.
In this example, the elements of a signal vector connected to In1
must be of the same type. The elements connected to In2
, however, may be of differing types.
Parameters and Dialog Box
-1
to have it automatically determined.Note The next parameter applies only to root-level inports. It does not appear on subsystem inport dialogs. |
Characteristics
Sample Time |
Inherited from driving block |
Dimensionalized |
Yes |
![]() | IC | Integrator | ![]() |