Is it possible to creat a text list of signal names in a bus?

4 visualizaciones (últimos 30 días)
I have several simulink models that I e become responsible for. I'm interested in exporting the names of signals in a selected bus to a spreadsheet. Is this possible? TIA

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 28 de Oct. de 2022
See if this helps you. Your model must have passed model update (Ctrl+D) without error.
Select a BusSelector block where the input bus is the one you are interested. Run
b=get_param(gcb,'InputSignals')
b includes all the signals in the bus. It may have a hirarchy. Wirte a script to expand it if too many levels.
celldisp(b) will expand all. Copy and paste and do some processing.
  2 comentarios
Bradley
Bradley el 28 de Oct. de 2022
Thank you so much! Very helpful. Can I ask what parameter name I would use for output signals in a BusCreator?
Fangjun Jiang
Fangjun Jiang el 31 de Oct. de 2022
BusCreator block has only one output, the bus.
If you meant to ask about BusSelector block, then
get_param('BusSelectorBlock','OutputSignalNames')
or get_param('BusSelectorBlock','OutputSignals')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interactive Model Editing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by