About the use of Data Store Memory
1 view (last 30 days)
Show older comments
Ming-Yuan Jeng on 2 Feb 2023
Commented: Fangjun Jiang on 8 Feb 2023
I need to exchange data using a large number of "Data Store Memory".(More than 100)
So I created a lot of "Data Store Memory" at the top of the model, but it would look ugly and messy.
If I put all the "Data Store Memory" into the subsystem, it will not be accessible everywhere in the model.
Is there a way to put these "Data Store Memory" into a subsystem and still be able to access them from anywhere?
Or is there any other way to package these "Data Store Memory"?
Fangjun Jiang on 3 Feb 2023
"You can use Simulink.Signal objects in addition to, or instead of, Data Store Memory blocks to define data stores. 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. See Data Stores for more information."
So, instead of adding a DataStoreMemory block and label it "A", you can just do this in Command Window, and then use DataStoreRead and DataStoreWrite block anywhere in the model.
Fangjun Jiang on 8 Feb 2023
That is true. There is no direct way. A few ways to help find those info:
- Model Data Editor, Data Stores tab, sort by name
- Ctrl+F in the model
- find_system() in script
- If tansfer the objects to a SLDD and link the SLDD to the model, then in the SLDD, you can select the object and right click, select "find where used"
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!