Link same input to several subsystems

조회 수: 5 (최근 30일)
Roman Foell
Roman Foell 2022년 5월 10일
답변: Hari 2023년 10월 1일
Hi all,
I am quite new to simulink, so do not be harsh please.
How do I link the same input of a main subsystem to several subsystems within the main subsystem? Is this even possible? An when not, why not?
Thanks.
Roman Föll

답변 (1개)

Hari
Hari 2023년 10월 1일
Hi Roman,
I understand that you want to connect the same input of a main subsystem to multiple subsystems within the main subsystem in Simulink.
One approach is to use a Bus object as the input to the main subsystem. A Bus object can contain multiple signals, and each subsystem within the main subsystem can extract the desired signals from the Bus object for processing.
Here are steps to do that:
  1. Define a Bus object that contains the desired signals
busInfo = Simulink.Bus.createObject({'signal1', 'signal2', 'signal3'});
busObject = eval(busInfo.busName);
2. Use the Bus object as the input to the main subsystem.
3. Within each subsystem, use the Bus Selector block to extract the desired signals from the Bus object and perform the required processing.
By utilizing a Bus object and the Bus Selector block, you can effectively share the same input across multiple subsystems within the main subsystem.
Refer to the documentation of “Bus Object” and “Bus Selector” for more information.
Hope this helps!

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by