Main Content

Trace Connections Using Interface Display

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 buses 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 to change the increment and reset the counter.

    sldemo_mdlref_counter_bus model

  2. On the Modeling tab, under Design, click Model 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.

    Show Perspectives views control

    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 buses are nested inside the subsystem named COUNTER.

    Interface display for sldemo_mdlref_counter_bus model

  3. Under counter_input, click data.

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

    Interface display with the bus element named data selected

  4. Double-click the subsystem named COUNTER.

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

  5. On the Modeling tab, click Update Model.

    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.

    Interface display with sample time colors

    Tip

    To display a legend of the meaning of sample time colors, on the Debug tab, select Information Overlays > Colors.

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

    Interface display with the counter_signal output interface selected

  7. If you want to print this diagram with the interfaces displayed, in the Simulation tab, click Print.

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

Interface display with units

To modify the attributes of the existing interface (such as signal names, data types, and dimensions), consider using the Model Data Editor. On the Modeling tab, click Model Data Editor.

Related Topics