Using merge block with bus signal inputs.

조회 수: 33 (최근 30일)
Benjamin Wang
Benjamin Wang 2012년 11월 16일
Hi, guys
I am really confused with the 'If/else -> Action -> Merge' pattern in Simulink, especially when working with Bus Signals.
Say, I created a bus with two members, 'a' and 'b', both are scalars with initial value of 0. I want to repeatedly increase 'a' by 1 when it is less than 5, and otherwise do nothing.
I know I could have merged the member 'a' rather than the whole bus signal. It's just an over-simplified version of my real work, which does lots of stuff in the 'If Action Subsystem'.
I was gonna upload a .mdl file to demonstrate my question more clear. Then I found that there is no way to do that here. So, for short, my question is: how to merge bus signals?
Thanks!
Ben

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 11월 16일
The Merge block does support bus signals. Look for the section called Bus Support in the documentation.
  댓글 수: 2
Benjamin Wang
Benjamin Wang 2012년 11월 19일
Thank you Kaustubha. Sorry, I'm late.
I knew that the Merge block supports bus signals. But I couldn't make it work in a straight forward way. Then I found out that I had to put a 'Signal Conversion' block in each 'If Action Subsystem', with its 'Output' parameter setting to 'Bus Copy'. Now my model works fine.
Kaustubha Govind
Kaustubha Govind 2012년 11월 19일
Great! Thanks for posting your solution.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by