Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Inport - Create input port for subsystem or external input

Library

Ports & Subsystems, Sources

Description

Inport blocks are the links from outside a system into the system.

Simulink software 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. Entering a value of -1 lets the Simulink software determine the port dimension.

The Sample time parameter is the rate at which the signal is coming into the system. A value of -1 causes the block to inherit its sample time from the block driving it. You might need to set this parameter for

For more information, see How to Specify the Sample Time in the Simulink User's Guide.

Inport Blocks in a Top-Level System

Inport blocks in a top-level system have two uses:

Limitation: You cannot use a top-level (root) inport to supply fixed-point data that is contained in a structure. Consider using a Simulink.Timeseries object instead of a structure.

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 topmost 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 icon as a port label. To suppress display of the label, select the Inport block and choose Format > Hide Name.

You can use a subsystem inport to supply fixed-point data in a structure or any other format.

Creating Duplicate Inports

You can create any number of duplicates of an Inport block. The duplicates are graphical representations of the original intended to simplify block diagrams by eliminating unnecessary lines. The duplicate has the same port number, properties, and output as the original. Changing properties of a duplicate changes properties of the original and vice versa.

To create a duplicate of an Inport block:

  1. Select the block.

  2. Select Edit > Copy in the Model Editor.

  3. Place your pointer in the block diagram where you want to create the duplicate.

  4. Select Edit > Paste Duplicate Inport in the Model Editor.

Connecting Buses to Root Level Inports

If you want a root level Inport of a model to produce a bus signal, you must select the Inport's Specify properties via bus object parameter and set the Inport's Bus object for validating input bus parameter to the name of a bus object that defines the bus that the Inport produces. If the bus contains mixed data types, the Inport's data type must be auto. See Using Bus Objects in the Simulink User's Guide for more information.

Data Type Support

The Inport block accepts complex or real signals of any data type supported by Simulink software, including fixed-point and enumerated data types. For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink.

Limitation: You cannot use a top-level (root) inport to supply fixed-point data that is contained in a structure. Consider using a Simulink.Timeseries object instead of a structure.

The numeric and data types of the block's output are the same as those of its input. You can specify the signal type, data type, and sampling mode of an external input to a root-level Inport block using the Signal type, Data type, and Sampling mode parameters.

The elements of a signal array connected to a root-level Inport block must be of the same numeric and data types. Signal elements connected to a subsystem input port can be of differing numeric and data types except in the following circumstance: If the subsystem contains an Enable or Trigger block or is an Atomic Subsystem and the input port, or an element of the input port, is connected directly to an output port, 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, can be of differing types.

Parameters and Dialog Box

The Main pane of the Inport block dialog box appears as follows:

The Signal Attributes pane of the Inport block dialog box appears as follows:

Show data type assistant

Display the Data Type Assistant.

Settings

The Data Type Assistant helps you set the Output data type parameter.

See Specifying Block Output Data Types for more information.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Port number

Specify the port number of the block.

Settings

Default: 1

This parameter controls the order in which the port that corresponds to the block appears on the parent subsystem or model block.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Icon display

Specify the information to be displayed on the icon of this input port.

Settings

Default: Port number

Signal name

Display the name of the signal connected to this port (or signals if the input is a bus).

Port number

Display port number of this port.

Port number and signal name

Display both the port number and the names of the signals connected to this port.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Latch input by delaying outside signal

Output the value of the input signal at the previous time step.

Settings

Default: Off

On

Output the value of the input signal at the previous time step.

Off

Do not output the value of the input signal at the previous time step.

Tips

Command-Line Information

See Block-Specific Parameters for the command-line information.

Latch input by copying inside signal

Copy the block's signal output into a buffer before executing the contents of the subsystem and use this copy as the block's output during execution of the subsystem.

Settings

Default: Off

On

Copy the block's signal output into a buffer before executing the contents of the subsystem and use this copy as the block's output during execution of the subsystem.

Off

Do not copy the block's signal output into a buffer before executing the contents of the subsystem to use as the block's output during execution of the subsystem.

Tips

Command-Line Information

See Block-Specific Parameters for the command-line information.

Interpolate data

Cause the block to interpolate or extrapolate output at time steps for which no corresponding workspace data exists when loading data from the workspace.

Settings

Default: On

On

Cause the block to interpolate or extrapolate output at time steps for which no corresponding workspace data exists when loading data from the workspace.

Off

Do not cause the block to interpolate or extrapolate output at time steps for which no corresponding workspace data exists when loading data from the workspace.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Specify properties via bus object

Use a bus object to define the structure of the bus that is input or output by this block.

Settings

Default: Off

On

Use a bus object to define the structure of the bus that is input or output by this block.

Off

Do not use a bus object to define the structure of the bus that is input or output by this block.

Tips

Selecting this parameter is required if the bus is nonvirtual (including a nonvirtual bus that was converted from a virtual bus as described in Automatic Bus Conversion) and is optional otherwise.

Dependencies

This parameter enables Bus object for validating input bus.

This parameter enables Output as nonvirtual bus in parent model.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Bus object for validating input bus

Specify the name of the bus object that defines the structure that a bus must have to connect to this port.

Settings

Default: BusObject

A bus object is an instance of class Simulink.Bus that is defined in the base workspace.

Tips

At the beginning of a simulation or when you update the model's diagram, Simulink software checks whether the bus connected to this port has the specified structure. If not, Simulink software displays an error message.

Dependencies

Specify properties via bus object enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Output as nonvirtual bus

Output a nonvirtual bus.

Settings

Default: Off

On

Output a nonvirtual bus.

Off

Output a virtual bus.

Tips

Dependency

Specify properties via bus object enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Port dimensions (-1 for inherited)

Specify the dimensions of the input signal to the block.

Settings

Default: -1

Valid values are:

-1

Dimensions are inherited from input signal

n

Vector signal of width n accepted

[m n]

Matrix signal having m rows and n columns accepted

Dependency

Clearing Specify properties via bus object enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Variable-size signal

Specify the type of signals allowed into this port.

Settings

Default: Inherit

Inherit

Allow variable-size and fixed-size signals.

No

Do not allow variable-size signals.

Yes

Allow only variable-size signals.

Dependencies

When the signal at this port is a variable-size signal, the Port dimensions parameter specifies the maximum dimensions of the signal.

Command-Line Information

Parameter: VarSizeSig
Type: string
Value: 'Inherit'| 'No' | 'Yes'
Default: 'Inherit'

Sample time (-1 for inherited)

Specify the time interval between samples.

Settings

Default: -1

To inherit the sample time, set this parameter to -1.

See How to Specify the Sample Time in the online documentation for more information.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Lock output data type setting against changes by the fixed-point tools

Select to lock the output data type setting of this block against changes by the Fixed-Point Tool and the Fixed-Point Advisor.

Settings

Default: Off

On

Locks the output data type setting for this block.

Off

Allows the Fixed-Point Tool and the Fixed-Point Advisor to change the output data type setting for this block.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

For more information, see Fixed-Point Tool and Fixed-Point Advisor in the Simulink Fixed Point documentation.

Signal type

Specify the numeric type of the external input.

Settings

Default: auto

auto

Accept either real or complex as the numeric type.

real

Specify the numeric type as a real number.

complex

Specify the numeric type as a complex number.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Sampling mode

Specify whether the output signal is Sample based or Frame based.

Settings

Default: auto

auto

Accept any sampling mode.

Sample based

The output signal is sample-based.

Frame based

The output signal is frame-based.

Tips

To generate frame-based signals, you must have the Signal Processing Blockset product installed.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Minimum

Specify the minimum value that the block should output.

Settings

Default: []

The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:

Tip

This number must be a double scalar value.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Maximum

Specify the maximum value that the block should output.

Settings

Default: []

The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:

Tip

This number must be a double scalar value.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Data type

Specify the output data type of the external input.

Settings

Default: Inherit: auto

Inherit: auto

A rule that inherits a data type

double

Data type is double.

single

Data type is single.

int8

Data type is int8.

uint8

Data type is uint8.

int16

Data type is int16.

uint16

Data type is uint16.

int32

Data type is int32.

uint32

Data type is uint32.

boolean

Data type is boolean.

fixdt(1,16,0)

Data type is fixed point fixdt(1,16,0).

fixdt(1,16,2^0,0)

Data type is fixed point fixdt(1,16,2^0,0).

Enum: <class name>

Data type is enumerated.

<data type expression>

The name of a data type object, for example Simulink.NumericType

Tips

This parameter can also be an expression that evaluates to a data type, for example, float('single')

Command-Line Information

See Block-Specific Parameters for the command-line information.

Mode

Select the category of data to specify.

Settings

Default: Inherit (Constant, Data Type Conversion, Discrete Time Integrator, Gain, Inport, Outport, Product, Saturation, Sum, Switch), Built in (Logical Operator, Relational Operator)

Inherit

Inheritance rules for data types. Selecting Inherit enables a second menu/text box to the right. The following list is the possible values, which can vary by block:

  • Inherit from 'Constant value' (Constant block default)

  • Inherit via internal rule (Discrete-Time Integrator, Gain, Product, Sum, Switch block default)

  • Inherit via back propogation (Data Type Conversion block default)

  • auto (Inport, Outport block default)

  • Logical (see Configuration Parameters: Optimization)

  • Same as first input

  • Same as input (Saturation block default)

  • Same as accumulator

Built in

Built-in data types. Selecting Built in enables a second menu/text box to the right. The following list is the possible values, which can vary by block:

  • double (Constant, Data Type Conversion, Discrete-Time Integrator, Gain, Inport, Outport, Product, Saturation, Sum, Switch block default)

  • single

  • int8

  • uint8

  • int16

  • uint16

  • int32

  • uint32

  • boolean (Logical Operator, Relational Operator block default)

Fixed point

Fixed-point data types.

Enumerated

Enumerated data types. This option is available on some blocks. Selecting Enumerated enables a second menu/text box to the right. The following list is the possible values, which can vary by block:

  • <class name>

Expression

Expressions that evaluate to data types. Selecting Expression enables a second menu/text box to the right. The following list is the possible values, which can vary by block:

  • <data type expression>

Dependency

Clicking the Show data type assistant button enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Using the Data Type Assistant in the Simulink User's Guide.

Signedness

Specify whether you want the fixed-point data as signed or unsigned.

Settings

Default: Signed

Signed

Specify the fixed-point data as signed.

Unsigned

Specify the fixed-point data as unsigned.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Word length

Specify the bit size of the word that holds the quantized integer.

Settings

Default: 16

Minimum: 0

Maximum: 32

Large word sizes represent large values with greater precision than small word sizes.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Scaling

Specify the method for scaling your fixed-point data to avoid overflow conditions and minimize quantization errors.

Settings

Default: Best precision (Constant), Binary point (Data Type Conversion, Discrete-Time Integrator, Gain, Inport, Outport, Product, Saturation, Sum, Switch), Integer (Logical Operator, Relational Operator)

Binary point

Specify binary point location.

Slope and bias

Enter slope and bias.

Best precision

Specify best-precision values. This option appears for some blocks.

Integer

Specify integer. This setting has the same result as specifying a binary point location and setting fraction length to 0. This option appears for some blocks.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Selecting Binary point enables:

Selecting Slope and bias enables:

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Fraction length

Specify fraction length for fixed-point data type.

Settings

Default: 0

Binary points can be positive or negative integers.

Dependencies

Selecting Scaling > Binary point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Slope

Specify slope for the fixed-point data type.

Settings

Default: 2^0

Specify any positive real number.

Dependencies

Selecting Scaling > Slope and bias enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Bias

Specify bias for the fixed-point data type.

Settings

Default: 0

Specify any real number.

Dependencies

Selecting Scaling > Slope and bias enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Characteristics

Sample Time

Specified in the Sample time parameter

Dimensionalized

Yes

Multidimensionalized

Yes

Virtual

Yes, if the block does not reside in a conditionally-executed or atomic subsystem and does not connect directly to an Outport block

For more information, see Virtual Blocks in the Simulink documentation.

See Also

Outport

  


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