Share data between two simulink models
조회 수: 12 (최근 30일)
이전 댓글 표시
Lets say I have following model

And I want the block in red will come from other model.I want the two models to run independently and having them talk to each other
I have read this https://www.mathworks.com/help/simulink/ug/share-data-with-other-matlab-system-blocks.html but I didn't help me I also tried to use this https://www.mathworks.com/help/instrument/examples/basic-udp-communication.html but I have received following error
The block 'UDP Send1' cannot be assigned a continuous sample time.
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 4월 2일
As you are using continuous time, you will need to use a single model with lines that connect the appropriate parts. This is needed so that Simulink can construct the differential equations needed to solve the system over indefinite time.
As soon as you refer to models "talking" to each other, you are talking about discrete events, that one model sometimes sends updates to the other, or one model sometimes queries the state of the other. Discrete events are incompatible with continuous time systems -- unless, that is, you set up portions to be triggered at particular times: if you did that then Simulink would treat those times as boundary conditions and do continuous modeling them.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!