Trace Connections Using Interface Display

How Interface Display Works

In the Simulink® Editor, you can turn on and off the display of interfaces in a model. When you are building large, complex models, you can connect or add signal lines between blocks or buses that are at different levels. The interface view allows you to trace signals through the nested levels. This capability helps you to:

  • Identify inputs and outputs.

  • Trace signal lines and bus elements to sources and terminations.

  • Annotate signal characteristics such as data type, dimensions, and sample time.

  • View units associated with signals, where applicable.

When you build a model, transition block pairs such as Inport and Outport and From and Goto help you to simplify connections of the crossovers among many signal lines. The interface view enables you to trace the hand-off and receipt between such blocks by way of colored highlights.

Trace Connections in a Subsystem

This example shows how to use the display of model interfaces to examine, trace, and understand the flow of signals and buses. This model propagates bus signals into referenced models.

  1. Open the model sldemo_mdlref_counter_bus.

    The counter_bus_input port channels the data and saturation limits of the counter to count and sets the upper and lower limit values. The increment_bus_input port channels a bus signal to change the increment and reset the counter.

  2. Select Display > Interface to enable the interface view.

    Tip

    Use the perspectives control in the lower-right corner of the model to toggle the display of interfaces.

    The three bars next to the counter_input and increment_input interfaces indicate the bus input signals. The single bars indicate data lines, such as counts per second, or command lines, such as reset, to start a new counting sequence. The three bars next to limits indicate that bus signals are nested inside the COUNTER subsystem.

  3. Under counter_input, click data.

    The path for the data appears in blue. The COUNTER subsystem is highlighted, indicating the path continues within it.

  4. Double-click the COUNTER subsystem.

    The continuation of the path for the data signal appears in blue.

  5. Select Simulation > Update Diagram.

    Note

    This model requires values from a parent model to simulate completely.

    The counter_signal interface displays these signal attributes, which help you to synchronize signals between blocks during simulation:

    • Data type: int32 (signed 32-bit integer)

    • Dimensions: (2) (a 1-D Simulink representation of a scalar)

    • Sample time: Ts:D1 (a discrete sample time of D1, which is the highest speed)

    In addition, when you update the diagram with interfaces displayed, the model displays the color code for sample time at each interface. For example, this model displays a red bar at each interface to indicate a sample time of D1.

    Tip

    To display a legend of the meaning of sample time colors, select Display > Sample Time > Colors.

  6. Click the counter_signal output interface to see the output of the bus outlined in blue, where the path ends.

  7. If you want to print this diagram with the interfaces displayed, select File > Print > Print.

When signals in your model have units associated with them, you see the units in the interface view. For example, in the model sldemo_metro, the Metronome1 subsystem shows units for inputs and outputs of the subsystem in the interface view.

To modify the attributes of the existing interface (such as signal names, data types, and dimensions), consider using the Model Data Editor (View > Model Data Editor). For information about the Model Data Editor, see Configure Data Properties by Using the Model Data Editor.

Related Topics