Get bus elements from output port

조회 수: 6 (최근 30일)
Marcus
Marcus 2025년 4월 16일
편집: Fangjun Jiang 2025년 4월 16일
I have a model that bundles signals in a Simulink.Bus object and outputs it via an Outport.
get_param(outport_block_handle,'OutDataTypeStr'); gives me the name of the Bus: 'Bus:myBusName'.
The Simulink.Bus is defined somewhere in a data dictionary buried somewhere in a chain of data dictionaries.
What is the easiest way to get the bus elements (signal1, signal2, ...) of the outport or at least their names respectively?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2025년 4월 16일
편집: Fangjun Jiang 2025년 4월 16일
If doing it interactively, you can hook a BusSelector block and then open the dialog
If through script, you can run Simulink.data.evalinGlobal(bdroot,'myBusName') to get the bus object and then get its elements.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Composite Interfaces에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by