Exporting signal of bus creator blocks to excel.

21 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

praguna manvi
praguna manvi il 11 Feb 2025
Modificato: praguna manvi il 11 Feb 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!

Più risposte (0)

Categorie

Scopri di più su Subsystems in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by