Data Store Memory
Define data store
Libraries:
Simulink /
Signal Routing
Description
The Data Store Memory block defines and initializes a named shared data store, which is a memory region usable by Data Store Read and Data Store Write blocks that specify the same data store name.
The location of the Data Store Memory block that defines a data store determines which Data Store Read and Data Store Write blocks can access the data store:
If the Data Store Memory block is in the top-level system, Data Store Read and Data Store Write blocks anywhere in the model can access the data store.
If the Data Store Memory block is in a subsystem, Data Store Read and Data Store Write blocks in the same subsystem or in any subsystem below it in the model hierarchy can access the data store.
A Data Store Read or Data Store Write block defined inside a referenced model can access the data stored at a higher level in the model hierarchy.
To allow a Data Store Read or Data Store Write block to access the data stored at a higher level in the model hierarchy from inside a referenced model:
Place a Data Store Memory block inside the referenced model.
In the Data Store Memory block dialog box, select Data store reference.
Do not include a Data Store Memory block in a For Each subsystem.
Obtaining correct results from data stores requires ensuring that data store reads and writes occur in the expected order. For details, see:
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.
You can select a Data Store Read, Data Store Write, or
Data Store Memory block to highlight blocks related to it. To show a
related block in an open diagram or new tab, pause on the ellipsis that appears after
selection. Then, select Related Blocks
from the action bar. When multiple blocks correspond
to the selected block, a list of related blocks opens. You can filter the list of
related blocks by entering a search term in the text box. After you select a related
block from the list, window focus goes to the open diagram or new tab that shows the
related block.
String Support
The Data Store Memory block can accept and output string data type only
if the block is configured for the default value of the Initial
value parameter (0
).
Examples
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
Version History
Introduced before R2006aSee Also
Data Store Read | Data Store Write
Topics
- Retrieve Data from Data Store Memory Blocks
- Data Stores
- Choose How to Define Data Stores
- C Data Code Interface Configuration for Model Interface Elements (Simulink Coder)
- Organize Parameter Data into a Structure by Using Struct Storage Class (Embedded Coder)
- Access Data Stores with Simulink Blocks
- Log Data Stores
- Code Generation for Data Store References (Simulink Coder)