Exporting signal of bus creator blocks to excel.

41 ビュー (過去 30 日間)
Antimo
Antimo 2025 年 2 月 3 日 12:58
編集済み: praguna manvi 2025 年 2 月 11 日 10:40
I have a fairly complex model with several subsystems. The number of these subsystems is not fixed, and some have different structures. Each subsystem includes both an input and output stage (which are also subsystems), where multiple signals are aggregated using a bus creator. I would like to automate the process of exporting the names of all signals in the generated buses.
I haven’t found much information on this, except for some MATLAB code that seems to work only if the names of the subsystem containing the bus creator and the bus creator itself are well known.

採用された回答

praguna manvi
praguna manvi 2025 年 2 月 11 日 10:39
編集済み: praguna manvi 2025 年 2 月 11 日 10:40
As I see, you are trying to programmatically access the names of all signals aggregated at different "Bus Creator" blocks. To perform this you could use "find_system" function as follows :
busCreators = find_system(bdroot, 'BlockType', 'BusCreator');
The above command finds all "Bus Creator" objects at various levels within the model. By default "find_system" searches at all levels for a "BlockType". The names of input signals or any other properties can be accesed using the "Handle" as followes:
busCreatorHandle = get_param(busCreators{1}, 'Handle'); %first busCreator object
signalNames = get_param(busCreatorHandle, 'InputSignalNames');
For more information on "get_param" and "find_system" functions, refer to the below documentation links:
Hope this helps!

その他の回答 (0 件)

カテゴリ

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