Main Content

Signal Label Propagation

You can give names to signals and configure the signals to propagate the signal names in a Simulink® model to track a signal through one block or many blocks. For a list of supported blocks, see Blocks That Support Signal Label Propagation.

When you name a signal and enable the display of signal label propagation for output signals of allowed blocks:

  • If there is a user-specified signal name that Simulink can propagate, the propagated signal label includes the name in angle brackets (for example, <sig1>).

  • If there is no signal name to propagate, Simulink displays an empty set of angle brackets (<>) for the label.

Simulink does not propagate signal labels for commented out blocks.

For example, in the following model, the output signal from the Subsystem block is configured for signal label propagation. The propagated signal label (<const>) is based on the name of the upstream output signal of the Constant block (const).

Simulink propagates subsystem input signal label to the subsystem output signal

For more information on how Simulink creates propagated signal labels, see How Simulink Propagates Signal Labels.

Blocks That Support Signal Label Propagation

You can propagate signal labels at the output of these blocks:

  • Bus Selector — The propagated names come from the inputs to the corresponding Bus Creator block, the inputs to the corresponding Out Bus Element block, the elements of the corresponding Simulink.Bus object, or similar.

  • Enable

  • From — The propagated name comes from the input to the corresponding Goto block.

  • Function-Call Split

  • In Bus Element — The propagated name depends on what the In Bus Element block selects.

    • When the In Bus Element block selects the entire input from a subsystem port, the block propagates the upstream name from the parent. To support this type of signal label propagation, the In Bus Element block must be in a subsystem, not a model.

    • When the In Bus Element block selects an element from a subsystem or model port, the block propagates the element name. (since R2024b)

  • Inport — The propagated name comes from the corresponding input to the parent subsystem. To support signal label propagation, the Inport block must be in a subsystem, not a model.

  • Model — When specified, the propagated names come from the Output name parameter of the corresponding Out Bus Element blocks (since R2023a) or the Signal name parameter of the corresponding Outport blocks. Otherwise, the propagated names come from the inputs to the corresponding Outport or Out Bus Element blocks.

  • Signal Specification

  • Subsystem — The propagated names come from the inputs to the corresponding Outport or Out Bus Element blocks.

  • Trigger

The Signal Properties dialog box for a signal indicates whether that signal supports signal label propagation. The Show propagated signals parameter is available only for blocks that support signal label propagation. For details, see Display Propagated Signal Labels.

How Simulink Propagates Signal Labels

In general, Simulink performs signal label propagation consistently:

  • For different modeling constructs (for example, nonbus signals and buses, virtual and nonvirtual buses, subsystem and model variants, model references, and libraries)

  • In models with or without hidden blocks, which Simulink inserts in certain cases to enable simulation

  • At model load, edit, update, and simulation times

For information about some special cases, see:

General Signal Label Propagation Processing

In general, when you enable signal label propagation for an output signal of a block (for example, BlockA), Simulink performs the following processing to find the source signal name to propagate:

  1. Checks the block whose output signal connects to BlockA, and if necessary, continues checking upstream blocks, working backward from the closest block to the farthest block.

  2. Stops when it encounters a block that either:

    • Supports signal label propagation and has a signal name

    • Does not support signal label propagation

  3. Obtains the signal name, if any, of the output signal for the block at which Simulink stops.

  4. Uses that signal name for the propagated signal label of any output signals of downstream blocks for which you enable signal label propagation.

For example, in the following model, suppose that you enable signal label propagation for the output signal for the Subsystem block (that is, the signal connected to the Out1 port).

Model showing signal label propagation for output signal of a subsystem which is at the root level of the model

Contents inside the subsystem which is at the root level of the model

Simulink checks inside the subsystem, checks upstream from the From and GoTo blocks (which support signal label propagation and do not have a name), and then checks further upstream, to the Constant block, which does not support signal label propagation.

Simulink uses the signal name of the Constant block output signal, const. The propagated signal label for the Subsystem block output signal is <const>.

Simulink propagates subsystem input signal label to the subsystem output signal

If the output signal from the Constant block did not have a signal name, then the propagated signal label would be an empty set of angle brackets (<>).

Simulink does not assign any label to the subsystem output signal when you do not assign any label to subsystem input signal

Suppose that in the Subsystem block you enable signal label propagation for the output signal from the In1 block, and you use the Signal Properties dialog box to specify the signal name const-from for the output signal of the From block, as shown below.

Assign signal name to the subsystem output signal using Signal Properties dialog box

The propagated signal label for the Subsystem block output signal changes to <const-from>, because that is the first named signal that Simulink encounters in its signal label propagation processing.

Signal label from inside the subsystem propagates to the signal connected to the subsystem output port at the root level of the model

In the following model, the signal label propagation for the output signal of the Subsystem block uses the signal name bus1, which is the name of the output bus of the Bus Creator block. The propagated signal label does not include the names of the bus element signals (a and b).

Simulink propagates subsystem input bus label to the subsystem output bus

Display Propagated Signal Labels

You can display propagated signal labels for individual signals, or display the propagated signal labels for all signals in a model. To display the labels for all signals, in the Simulink Editor, on the Debug tab, select Information Overlays > Propagated Signal Labels.

To display a propagated signal label for an individual signal:

  1. Right-click the signal for which you want to display a propagated signal label and select Properties.

  2. In the Signal Properties dialog box, select Show propagated signals.

    Signal Properties dialog box

    The Show propagated signals parameter is available only for output signals from blocks that support signal label propagation.

To configure a signal to display its propagated name programmatically, use the set_param function to specify the value of the ShowPropagatedSignals property for the port handle that corresponds to the block output port that produces the signal. For example, to enable signal label propagation for the output signal on the first output port of Subsystem block Subsystem in the model MyModel:

  1. Use the get_param function to get the port handles for the block.

    portHandles = get_param("MyModel/Subsystem","PortHandles");
  2. Access the handle for the first output port by index. The block port handles are returned as a structure that contains a field for each type of port the block might have.

    outport1 = portHandles.Outport(1);
  3. Use the set_param function to specify the value for the ShowPropagatedSignals parameter for the output port as on.

    set_param(outport1,ShowPropagatedSignals="on")

If a signal already has a label, then an alternative approach for displaying a propagated signal label is:

  1. In the model diagram, click the signal label.

  2. Remove the label text.

  3. In the signal label text box, enter an angle bracket (<).

  4. Click outside the signal label.

    Simulink displays the propagated signal label.

Special Cases of Signal Propagation

Processing for Referenced Models

To enable signal label propagation for referenced models, in addition to the steps described in Display Propagated Signal Labels, use the default setting for the Model Configuration Parameters > Model Referencing > Propagate all signal labels out of the model parameter. In other words, make sure the parameter is enabled.

If you make a change inside a referenced model that affects signal label propagation, the propagated signal labels outside of the referenced model do not reflect those changes until after you update the diagram or simulate the model.

For example, the model ex_signal_label_prop_model_ref has a referenced model that includes an output signal from the In1 block that has a signal name of input_1.

If you enable signal label propagation for the signal from the Out1 port of the Model block, that signal does not reflect the name input_1 until after you update the diagram or simulate the model.

Model block output signal label

Contents inside the model referenced by the Model block

Processing for Variants and Configurable Subsystems

Simulink updates the propagated signal label (if enabled) for the output signal of the Subsystem or Model block, when both of these conditions occur:

  • The output signals for variant models have different signal names.

  • You change the active variant model or variant subsystem.

For Subsystem blocks, the signal label updates at edit time. For Model blocks, the update occurs when you update diagram or simulate the model.

See Also

Related Topics