Read data from data store
The data store from which the data is read is determined by the location of the Data Store Memory block or signal object that defines the data store. For more information, see Data Stores and Data Store Memory.
The Data Store Read block can output a real or complex signal of these data types:
The block does not support variable-size signals.
For more information, see Data Types Supported by Simulink in the Simulink® documentation.
You can use arrays of buses with a Data Store Read block. For details about defining and using an array of buses, see Combine Buses into an Array of Buses.
The Parameters pane of the Data Store Read block dialog box appears as follows:
Specifies the name of the data store from which this block reads
data. The adjacent pull-down list lists the names of Data Store Memory
blocks that exist at the same level in the model as the Data Store
Read block or at higher levels. The pulldown list also includes all
in the base and model workspaces. To change the name, select a name
from the pull-down list or enter the name directly in the edit field.
When Simulink software compiles the model containing this
block, Simulink software searches the model upwards from this
block's level for a Data Store Memory block having the specified data
store name. If Simulink software does not find such a block,
it searches the model workspace and the MATLAB® workspace for
having the same name. See Symbol Resolution for more information about the search
If Simulink software finds the signal object, it creates
a hidden Data Store Memory block at the model's root level having
the properties specified by the signal object and an initial value
0. If Simulink software finds neither the
Data Store Memory block nor the signal object, it halts the compilation
and displays an error.
This field lists the Data Store Memory block that initialized the store from which this block reads.
This parameter lists all the Data Store Write blocks with the same data store name as this block that are in the same (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.
The sample time, which controls when the block reads from the
data store. A value of
-1 indicates that the sample
time is inherited. See Specify Sample Time for more information.
The Element Selection pane of the Data Store Read block dialog box appears as follows:
Use the Element Selection pane to select a subset of the bus or matrix elements defined for the associated data store. The Data Store Read block icon reflects the elements that you specify. For details, see Accessing Specific Bus and Matrix Elements.
For bus signals, lists the elements in the associated data store. The list displays the maximum dimensions for each element, in parentheses.
For data stores with a bus data type, you can expand the tree to view the bus elements. For data stores with arrays, you can read the whole data store, or you can specify one or more elements of the whole data store.
You can select an element and then use one of the following approaches:
Click Select>> to display that element (and all its subelements) in the Selected element(s) list.
Use the Specify element(s) to select edit box to specify the bus or matrix elements that you want to select for reading. Then click Select>>.
To refresh the display to reflect modifications to the bus or matrix used in the data store, click Refresh.
Enter a MATLAB expression to define the specific element
that you want to read. For example, for a data store named
has maximum dimensions of
[3,5], you could enter
expressions such as
DSM(2, 4) or
3], 2) in the edit box and then click Select>>.
To apply the element selection, click OK.
Displays the elements that you select. The Data Store Read block icon displays a port for each element that you specify.
To change the order of bus or matrix elements in the list, select the element in the list and click Up or Down. Changing the order of the elements in the list changes the order of the ports. To remove an element, click Remove.
Double | Single | Boolean | Base Integer | Fixed-Point | Enumerated | Bus
Specified in the Sample time parameter