Documentation

Display Information About Buses

Viewing information about bus signals can help you during model creation, debugging, and analysis. To view information about buses, you can use different approaches, depending on your modeling task:

信号层次结构Viewer

You can use the Signal Hierarchy Viewer to display information about a signal. To display the bus hierarchy:

  1. Right-click a signal line.

  2. Select the信号层次结构选择。这个标志al Hierarchy Viewer dialog box appears.

例如,打开busdemomodel.

Right-click themain_bus信号(输出信号公共汽车创建者block), and select信号层次结构.

Each Signal Hierarchy Viewer is associated with a specific model. If you edit a model while the associated Signal Hierarchy Viewer is open, the Signal Hierarchy Viewer reflects those updates.

You can also open the Signal Hierarchy Viewer in the Simulink®Editor.

  1. SelectDiagram>Signals & Ports>信号层次结构.

  2. 选择一个信号。

不te

To produce accurate results at edit time, the Signal Hierarchy Viewer requires that the model compiles successfully.

To filter the displayed signals, click theOptionsbutton on the right-hand side of theFilter by nameedit box ().

  • 要使用MATLAB正则表达式进行过滤信号名称,请选择Enable regular expression. For example, to display all signals whose names end with a lowercaser(and their immediate parents), enterr $在里面Filter by nameedit box. For details, seeRegular Expressions(MATLAB)。

  • To use a flat list format to display the list of filtered signals, based on the search text in theFilter by name编辑框,选择Show filtered results as a flat list. The flat list format uses dot notation to reflect the hierarchy of bus signals. This example shows a flat list format for a filtered set of nested bus signals.

Port Value Display

要在模拟之前显示特定端口或端口值的值或端口值,请右键单击信号并选择Show Value Label of Selected Port.

对于巴士信号,Show Value Label of Selected Portoption opens a dialog box where you can select from all signals in the bus. For example, in this model, you can see the dialog box for all signals that are contained inModelBus.

For more information about port value display, seeDisplay Value for a Specific Port.

汇编的布斯特型和SignalHierarchyParameters

To get information about the type and hierarchy of a bus signal in a compiled model, use these parameters with theget_paramcommand:

  • 汇编的布斯特型- 对于编译模型,返回有关连接到端口的信号是总线以及信号是虚拟或非虚拟总线的信息。

  • SignalHierarchy— If the signal is a bus, returns the name and hierarchy of the signals in the bus.

Before you use these commands, for汇编的布斯特型, update the diagram or simulate the model.

For example, open and simulate thebusdemomodel.

This code illustrates how you can use theSignalHierarchy汇编的布斯特型parameters:

mdl ='busdemo';open_system(MDL)%获得句柄端口ph = get_param([mdl'/bus creator'],'porthandles');%signalHierArchy可以在编辑时间内获得SH = get_param(ph.outport,'signalHierArchy')%编译模型busdemo([],[],[],[],'compile');bt = get_param(ph.outport,'CommiledBustype')%终止模型busdemo([],[],[],[],'term');

相关话题

Was this topic helpful?