How to get the Signal Names in the Bus Creator

24 ビュー (過去 30 日間)
krishnasutha
krishnasutha 2012 年 8 月 1 日
hi,
I am using MATLAB 2007a to get the Signal Names in a BusCreator within a library model. I tried uisng following script:
ph = get_param(gcb,'PortHandles');
lh = get_param(ph.Outport,'line');
set(lh,'signalPropagation','all'); % Even I tried with, set(lh,'signalPropagation','on');
SigNames = get_param(ph.Outport(1),'PropagatedSignals');
But SigNames turns out to be an empty string. In the model a symbol '<>' appears at the output line of the BusCreator. If i click on the symbol, all the output signals appear. Also the command,
SigNames = get_param(ph.Outport(1),'PropagatedSignals');
returns a comma separated string of signal names in the BusCreator.
Please help me to solve the above problem, so that I can get the signal names in the BusCreator without opening the library.
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2012 年 8 月 1 日
I'm not sure that such information is possible to obtain from a library model. You might need to instantiate the block in a regular model. You can do this programmatically using add_block (you will need to load the library using load_system before using add_block).

サインインしてコメントする。

回答 (2 件)

Albert Yam
Albert Yam 2012 年 8 月 1 日
Do you mean the names of the signals going in/out of the Bus Creator?
lh = get_param(gcb,'LineHandles');
sigs_in = get_param(lh.Inport,'Name')
sigs_out = get_param(lh.Outport,'Name')
[note Simulink 6.6.1]
  1 件のコメント
Albert Yam
Albert Yam 2012 年 8 月 8 日
When you say you get href = ""</a>, is this a Bus Selector? I only recall getting name when it is a selector and you can't change the name. Or.. is there a Bus Object associated with the Bus creator?

サインインしてコメントする。


krishnasutha
krishnasutha 2012 年 8 月 2 日
Thanks Albert. But
sigs_in = get_param(lh.Inport,'Name')
also returns empty cell. If i use
set(lh.Inport,'signalpropagation','on')
then, on each input signal line '<>' symbol appears. But will not return names. If I click on that symbol, names will appear for those lines. Still output is empty cell.

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by