Info

This question is closed. Reopen it to edit or answer.

Run Simulink models in parallel while sharing data stores

1 view (last 30 days)
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!

Answers (1)

Prashant Arora
Prashant Arora on 8 Mar 2017
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.

This question is closed.

Community Treasure Hunt

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

Start Hunting!