How to get inport's Bus type assigned for In Bus Element blocks
5 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Gergely
2023-8-9
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!