Info

此问题已关闭。 请重新打开它进行编辑或回答。

Run Simulink models in parallel while sharing data stores

2 次查看(过去 30 天)
I am looking to run two different Simulink models in parallel in a main model. The two models need to share 2 data store memory variables. One of the models is computationally expensive and is executed only when a certain condition on one of the data store variables is met. The other model needs to run continuously while writing to the data store variables. I have implemented task parallelism as described in the following example: https://www.mathworks.com/help/simulink/ug/implement-task-parallelism-in-simulink.html
However, I could not share the data store variables across models as task parallelism requires all blocks to be in sub-models and global data store sharing requires variables to be defined in the main model, if I understood it correctly
1. How could I share data store memory globally across models while running models in parallel?
2. How could I run the fast executing model at the same rate without being affected by the fact that the slow executing model is running or not?
I would appreciate any advice in this regard. Thanks!

回答(1 个)

Prashant Arora
Prashant Arora 2017-3-8
Hi Priyanshu,
Regarding your question about global data stores, you can use Simulink.Signal objects to define data stores in base workspace. A data store defined in the base workspace with a signal object is a global data store. Global data stores are accessible to every model, including all referenced models.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by