Share data between two simulink models
12 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 2 Apr 2019
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 Comments
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!