Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Run Simulink models in parallel while sharing data stores

1 visualización (últimos 30 días)
Priyanshu Agarwal
Priyanshu Agarwal el 1 de Mzo. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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!

Respuestas (1)

Prashant Arora
Prashant Arora el 8 de Mzo. de 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.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by