| Simulink® | ![]() |
Signal Routing

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 with the same data store name.
The location of the Data Store Memory block that defines a data store determines the Data Store Read and Data Store Write blocks that can access the data store:
If the Data Store Memory block is in the top-level system, the data store can be accessed by Data Store Read and Data Store Write blocks located anywhere in the model.
If the Data Store Memory block is in a subsystem, the data store can be accessed by Data Store Read and Data Store Write blocks located in the same subsystem or in any subsystem below it in the model hierarchy.
Note You can use signal objects in addition to or instead of Data Store Memory blocks to define data stores. See Working with Data Stores for more information. |
You initialize the data store by specifying a scalar value or an array of values in the Initial value parameter. The dimensions of the array determine the dimensionality of the data store. Any data written to the data store must have the dimensions designated by the Initial value parameter. Otherwise, an error occurs.
The Data Store Memory block stores real or complex signals of any data type supported by Simulink® software, including fixed-point data types.
For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink®.
The Main pane of the Data Store Memory block dialog appears as follows:

Specify a name for the data store you are defining with this block. Data Store Read and Data Store Write blocks with the same name will be able to read from and write to the data store initialized by this block.
This parameter lists all the Data Store Read and Data Store Write blocks that have the same data store name as the current block, and that are in the current (sub)system or in any subsystem below it in the model hierarchy. Double-click any entry on this list to highlight the block and bring it to the foreground.
Specify the initial value or values of the data store. The dimensions of this value determine the dimensions of data that may be written to the data store.
Causes Simulink software, when compiling the model, to search the model and base workspace for a Simulink.Signal object having the same name. If such an object is not found, Simulink software halts the compilation and displays an error. Otherwise Simulink software compares the attributes of the signal object with the corresponding attributes of the data store memory block. If the block and the object attributes are inconsistent, Simulink software halts model compilation and displays an error.
These following parameters pertain to code generation and have no effect during model simulation:
Data store name must resolve to Simulink signal object
RTW storage class
RTW type qualifier
See Block State Storage and Interfacing in the Real-Time Workshop® documentation for more information.
If selected and the Initial value parameter is specified as a column or row matrix, the data store is initialized to a 1-D array whose elements are equal to the elements of the row or column vector. See Determining the Output Dimensions of Source Blocks.
The Signal Attributes pane of the Data Store Memory block dialog appears as follows:

Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:
Parameter range checking (see Checking Parameter Values)
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:
Parameter range checking (see Checking Parameter Values)
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Specify the output data type. You can set it to:
A rule that inherits a data type, for example, Inherit: auto
The name of a built-in data type, for example, single
The name of a data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, float('single')
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Data
type parameter.
See Specifying Block Output Data Types for more information.
Specify the numeric type, real or complex, of the values stored in the data store.
The Diagnostics pane of the Data Store Memory block dialog appears as follows:

The model is attempting to read data from this data store without having previously written data into the store in the current time step.
The model is attempting to store data in this data store after previously reading data from it in the current time step.
The model is attempting to store data in this data store twice in succession in the current time step.
Sample Time | N/A |
Dimensionalized | Yes |
Multidimensionalized | Yes |
Data Store Read, Data Store Write
![]() | Counter Limited | Data Store Read | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |