Signal Label Propagation
You can give signals signal names and configure propagating the signal names in a Simulink® model to track a signal label 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,
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 (
For more information on how Simulink creates propagated signal labels, see How Simulink Propagates Signal Labels.
Blocks That Support Signal Label Propagation
You can use signal label propagation with output signals for several connection blocks, which route signals through the model without changing the data. Connection blocks perform no signal transformation.
Also, Model blocks support signal label propagation.
The connection blocks that support signal label propagation are:
The Bus Creator and Bus Selector blocks do not support signal label propagation. However, if you want to view the hierarchy for any bus, use the Display Bus Hierarchy.
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, non-bus and bus signals, virtual and nonvirtual buses, subsystem and model variants, model referencing, 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:
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.
Stops when it encounters a block that either:
Supports signal label propagation and has a signal name
Does not support signal label propagation
Obtains the signal name, if any, of the output signal for the block at which Simulink stops.
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
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 farther 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
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 (
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
const-from for the output signal of the
From block, as shown below.
The propagated signal label for the Subsystem block
output signal changes to
because that is the first named signal that Simulink encounters in its signal label propagation
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 (
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:
Right-click the signal for which you want to display a propagated signal label and select Properties.
In the Signal Properties dialog box, select Show propagated signals.
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
set_param function to
specify the value of the
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
get_paramfunction to get the port handles for the block.
portHandles = get_param("MyModel/Subsystem","PortHandles");
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);
set_paramfunction to specify the value for the
ShowPropagatedSignalsparameter for the output port as
If a signal already has a label, then an alternative approach for displaying a propagated signal label is:
In the model diagram, click the signal label.
Remove the label text.
In the signal label text box, enter an angle bracket (
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
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.
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.