Documentation

信号标签传播

传播信号标签

When you enable the display of signal label propagation for output signals of the blocks listed in支持信号标签传播的块万博1manbetx:

  • 如果有一个用户指定的信号名称万博1manbetx®可以传播,传播信号标签包括角度括号中的名称(例如,)。

  • 如果没有信号名称要传播,simulink将显示一组空角括号(万博1manbetx<>)标签。

例如,在以下模型中,为信号标签传播配置了来自子系统块的输出信号。传播信号标签() is based on the name of the upstream output signal of the Constant block (const)。

有关Simulink如何创建传播信号标签的更多信息,请参万博1manbetx见How Simulink Propagates Signal Labels

支持信号标签传播的块万博1manbetx

您可以将信号标签传播带有多个输出信号联系块,这些块在不更改数据的情况下通过模型路由信号。连接块不执行信号转换。

Also, Model blocks support signal label propagation.

支持信号标签传播的连接块是:万博1manbetx

  • Enable

  • 功能调用分式

  • INPORT(仅子系统;不是根本INPORTS)

  • 信号规范

  • Subsystem (through subsystem Inport and Outport blocks)

  • 扳机

  • 双向连接(Simscape™块)

公共汽车创建者和公交选择器块做notsupport signal label propagation. However, if you want to view the hierarchy for any bus signal, use theSignal Hierarchy Viewer

信号的信号属性对话框表示信号是否支持信号标签传播。万博1manbetx这Show propagated signalsparameter is available only for blocks that support signal label propagation. For details, see显示传播信号标签

显示传播信号标签

To display a propagated signal label:

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

  2. 在“信号属性”对话框中,选择Show propagated signals

    Show propagated signals参数仅适用于支持信号标签传播的块的输出信号。万博1manbetx

要以编程方式启用此信号属性,请为信号线创建一个句柄,并指定信号传播as'on'。例如,您可以使用此代码来启用或禁用模型图中所有信号的属性。

% Create an array of handles to every signal line in the diagram信号= find_system(GCS,'FindAll','on','类型','line');% Enable or disable the property for each signal linefori = 1:长度(信号)%set(信号(i),“信号传播”,“ off”);set(信号(i),“信号传播”,'on');end

如果信号已经具有标签,则选择显示传播信号标签的方法是:

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

  2. 删除标签文本。

  3. 在信号标签文本框中,输入角度括号(<)。

  4. Click outside the signal label.

    Simulink displays the propagated signal label.

How万博1manbetx传播信号标签

了解Simulink如何传播信号标签万博1manbetx可以帮助您:

  • Anticipate the scope of the signal label propagation, from source to final destination

  • 配置您的模型以显示您想要的信号的信号标签

For output signals from supported blocks, you can choose to have Simulink display propagated signal labels. For a list of supported blocks, see支持信号标签传播的块万博1manbetx

通常,Simulink始万博1manbetx终执行信号标签的传播:

  • 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:

通用信号标签传播处理

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. 当它遇到一个块时停止:

    • 万博1manbetx支持信号标签传播,并具有信号名称

    • 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 theOUT1port).

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。子系统输出信号的传播信号标签为

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 (<>)。

假设在“子系统块”中,您可以从IN1块中启用信号标签的输出信号传播,然后使用“信号属性”对话框指定信号名称const-fromfor the output signal of the From block, as shown below.

这propagated signal label for the Subsystem output signal changes to,因为那是模拟链接在其信号标签传播处理中遇到的第一个命名信号。万博1manbetx

In the following model, the signal label propagation for the output signal of the Subsystem block uses the signal namebus1,这是总线创建器块的输出总线信号的名称。传播信号标签不包括总线元素信号的名称(ab)。

引用模型的处理

除了所述的步骤外,还为引用模型启用信号标签传播显示传播信号标签, use the default setting for the模型配置参数>模型引用>传播模型中的所有信号标签范围。换句话说,请确保启用参数。

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 modelex_signal_label_prop_model_ref有一个引用模型,该模型包含来自IN1块的输出信号,该信号具有一个信号名称input_1

如果您从模型块的OUT1端口启用信号标签传播,则该信号确实not反映名称input_1直到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两个都of these conditions occur:

  • 模型参考变体的输出信号具有不同的信号名称。

  • 您可以更改活动变体模型或变体子系统。

对于子系统块,信号标签在编辑时更新。对于模型块,当您更新图表或模拟模型时,则会发生更新。

相关话题

这个话题有帮助吗?