Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Run Simulink models in parallel while sharing data stores

1 Ansicht (letzte 30 Tage)
Priyanshu Agarwal
Priyanshu Agarwal am 1 Mär. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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!

Antworten (1)

Prashant Arora
Prashant Arora am 8 Mär. 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.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by