⟹

Input Port

Subsystems
Run the live example Free · no sign-up · runs in your browser

The InPort (Input Port) block establishes an input interface for a Subsystem container. It receives signals arriving at the subsystem's external boundary and exposes them internally to downstream blocks.

Placing an InPort inside a subsystem automatically generates a corresponding input pin on the parent Subsystem block in the outer diagram, enabling modular, hierarchical model construction and clean encapsulation of complex dynamical systems.

Mathematical Model

The InPort block operates as a transparent signal boundary pass-through:

yinternal(t)={uexternal(t),if external subsystem port is connectedvdefault,otherwisey_{\text{internal}}(t) = \begin{cases} u_{\text{external}}(t), & \text{if external subsystem port is connected} \\ v_{\text{default}}, & \text{otherwise} \end{cases}

where:

  • uexternal(t)u_{\text{external}}(t) is the signal connected to the Subsystem block's outer input pin.
  • vdefaultv_{\text{default}} is the configured defaultValue parameter.
  • The signal crosses the hierarchical boundary instantaneously with zero phase lag:
Δtboundary=0\Delta t_{\text{boundary}} = 0

Inputs & Outputs

Direction ID Label Type Status
← Out out Internal Output number Output

Parameters

Parameters Label Type Default Description
portName Port Name text input1
defaultValue Default Value number 0

Usage Examples

Example 1: Closed-Loop Speed Controller Subsystem Interface

Constructing a modular speed controller subsystem containing error calculation and PID compensation. Adding two InPort blocks named "setpoint" and "feedback" inside the subsystem generates two distinct input pins on the parent subsystem block, allowing clean external wiring to reference generators and tachometers.

Example 2: Multi-Axis Kinematic InPort Array

Encapsulating a 3-axis robot arm kinematics calculation inside a subsystem. Three InPort blocks named "x_ref", "y_ref", and "z_ref" with defaultValue = 0.0 expose clean Cartesian reference inputs on the subsystem boundary.

Remarks & Best Practices

  • Subsystem Boundary Generation: Each InPort block placed inside a subsystem dynamically creates an external input connection handle on the parent Subsystem block.
  • Zero Propagation Latency: Signals pass from external connections to internal blocks within the same solver timestep with zero numerical phase lag.
  • Safe Default Fallback: When an external connection is missing, defaultValue provides a well-defined fallback to prevent undefined or NaN states.
  • Subsystem Layout Convention: Place InPort blocks on the left side of the subsystem canvas to maintain standard left-to-right (West-to-East) signal flow.

Related Components

  • OutPort: Output boundary interface block for Subsystems.
  • Subsystem: Hierarchical model container block.
  • From: Wireless intra-diagram signal receiver.
  • ExternalInput: Injects externally manipulated values via Agent API or UI.