Create input port for subsystem or external input
Simulink / Commonly Used Blocks
Simulink / Ports & Subsystems
Simulink / Sources
HDL Coder / Commonly Used Blocks
HDL Coder / Ports & Subsystems
HDL Coder / Sources
Inportblocks link signals from outside a system into the system.
金宝app®software assignsInportblock port numbers according to these rules:
It automatically numbers theInportblocks within a top-level system or subsystem sequentially, starting with 1.
If you add anInportblock, the label is the next available number.
If you delete anInportblock, other port numbers are automatically renumbered to ensure that the Inport blocks are in sequence and that no numbers are omitted.
If you copy anInportblock into a system, its port number isnotrenumbered unless its current number conflicts with an inport already in the system. If the copiedInportblock port number is not in sequence, renumber the block. Otherwise, you get an error message when you run the simulation or update the block diagram.
You can use anInportblock in a top-level system to:
Supply external inputs from the workspace using one of these approaches. If no external outputs are supplied, then the default output is the ground value.
Use theConfiguration Parameters>Data Import/Export>Inputparameter. SeeLoad Data to Root-Level Input Ports.
Tip
To import many signals to root-level input ports, consider using the Root Inport Mapper tool. For more information, seeMap Data Using Root Inport Mapper Tool.
Use theut
argument of thesim
command to specify the inputs.
Provide a means for perturbation of the model by thelinmod
andtrim
analysis functions.
UseInportblocks to inject inputs into the system. SeeLinearizing Models.
To load logged signal data using rootInportblocks, use the
function to create acreateInputDataset
Dataset
object that contains elements corresponding to root-levelInportblocks.
Inportblocks in a subsystem represent inputs to the subsystem. A signal arriving at an input port on aSubsystemblock flows out of the associatedInportblock in that subsystem. TheInportblock associated with an input port on aSubsystemblock is the block whosePort numberparameter matches the relative position of the input port on the Subsystem block. For example, theInportblock whosePort numberparameter is1
gets its signal from the block connected to the topmost port on theSubsystemblock.
If you renumber thePort numberof anInportblock, the block becomes connected to a different input port. The block continues to receive its signal from the same block outside the subsystem.
Inport blocks inside a subsystem supportsignal label propagation, but root-level Inport blocks do not.
你可以directly edit port labels on aSubsystemblock. For more information, seeEdit Port Labels on Subsystems.
Tip
For models that include buses composed of many bus elements, consider usingIn Bus ElementandOut Bus Elementblocks. These blocks:
Reduce signal line complexity and clutter in a block diagram.
Make it easier to change the interface incrementally.
Allow access to a bus element closer to the point of usage, avoiding the use of aBus SelectorandGotoblock configuration.
TheIn Bus Elementblock is of block typeInportand theOut Bus Elementblock is of block typeOutport.
You can create any number of duplicates of anInportblock. 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.
To create a duplicate of anInportblock:
In the block diagram, select the unconnectedInportblock that you want to duplicate.
Press and hold theCtrlkey and drag the block.
Release the mouse and then selectDuplicatefrom the context menu.
You can select anInportblock that has duplicates to highlight the duplicate blocks. To show a related block in an open diagram or new tab, pause on the ellipsis that appears after selection. Then, selectRelated Blocksfrom the action bar. When multiple blocks correspond to the selected block, a list of related blocks opens. You can filter the list of related blocks by entering a search term in the text box. After you select a related block from the list, window focus goes to the open diagram or new tab that shows the related block.
If you want a root-levelInportblock of a model to produce a bus, set theData typeparameter to the name of a bus object that defines the bus that theInportblock produces. For more information, seeSpecify Bus Properties with Simulink.Bus Object Data Types.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Outport|Asynchronous Task Specification(Simulink Coder)|In Bus Element