フィルターのクリア

How to identify buses used within a model

24 ビュー (過去 30 日間)
Andy
Andy 2013 年 10 月 23 日
回答済み: Duke 2013 年 10 月 24 日
I am trying to create a script that will list all dependencies of a simulink model. So far I have successfully managed to list all referenced models and all library links within a model, however I cannot figure out how to list all bus definitions that are used within the model. Has anyone got any ideas?
cheers,
andy

採用された回答

ES
ES 2013 年 10 月 23 日
find_system(ModelName,'BlockType','BusCreator'); Be sure to turn follow links, look under mask in your find system query..
  2 件のコメント
Andy
Andy 2013 年 10 月 23 日
this does find all the bus creators within the model, however the problem is my bus definitions are used to "Data Type" input and output ports of some subsystems. All of my bus creators are left as inherit auto. Is there perhaps a way of finding all input or output ports with a data type of bus?
ES
ES 2013 年 10 月 24 日
You can find any property of any component in a simulink model. For the Bus Creators and Bus selectors, there will Ports property. Using the Ports property you can reach the destinations or sources and find their datatypes. It is always possible..

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

その他の回答 (1 件)

Duke
Duke 2013 年 10 月 24 日
lines = find_system(bdroot, 'FindAll', 'on', 'Type', 'line');
for ii = 1:length(lines)
lineObject = get_param(get_param(lines(ii), 'SrcPortHandle'), 'SignalHierarchy');
if ~isempty(lineObject.BusObject)
% Do work
end
end

カテゴリ

Help Center および File ExchangeDependency Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by