Exporting signal of bus creator blocks to excel.

7 vues (au cours des 30 derniers jours)
Antimo
Antimo le 3 Fév 2025
Modifié(e) : praguna manvi le 11 Fév 2025
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.

Réponse acceptée

praguna manvi
praguna manvi le 11 Fév 2025
Modifié(e) : praguna manvi le 11 Fév 2025
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!

Plus de réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by