Borrar filtros
Borrar filtros

How to get inport's Bus type assigned for In Bus Element blocks

6 visualizaciones (últimos 30 días)
Gergely Pekáry
Gergely Pekáry el 18 de Mzo. de 2022
Respondida: Gergely el 9 de Ag. de 2023
How to get inport's data type using the matlab api of an inport assigned to In Bus Element ports?
For example here the ExampleSubsystem is in a Library Model and it has an input defined using the In Bus Element as
(where the ExampleBus is a bus definition present at the base workspace)
My aim is to programatically access/parse the Bus type assigned to the port named InBus (which in this case would be ExampleBus).
In case of regular inports the data type can be accessed easily via the block handle, however, here I can only get the PortName, Element, isBusElementPort properties... but not the Bus type name.
I know the "model" could be compiled and then I could access the CompiledPortDataTypes property, but this is not an option for me as I want to parse subsystems inside library models.
The very reason I would like to do this programatically is to build a harness model for the subsystem and I need the data type that I have to connect to the port InBus.

Respuestas (1)

Gergely
Gergely el 9 de Ag. de 2023
I had the same issue.
The workaround is to programmatically clear the selected 'Element', and then the 'OutDataTypeStr' will be the bus type. Then you can restore the element.

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by