Read data from data store
Simulink / Signal Routing
The Data Store Read block copies data from the named data store to its output. More than one Data Store Read block can read from the same 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.
Obtaining correct results from data stores requires ensuring that data store reads and writes occur in the expected order. See Order Data Store Access and Data Store Diagnostics for details.
Port_1
— Values from specified data storeValues from the specified data store, output with the same data type and dimensions as in the data store. The block supports both real and complex signals. You can choose whether to output the entire data store, or only selected elements from the data store.
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.
Data Types: single
| double
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
| bus
Data store name
— Name of data store from which this block readsA
(default) | name of data storeSpecifies the name of the data store from which this block reads data.
The adjacent drop-down list provides 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 list
also includes all Simulink.Signal
objects in the base
and model workspaces. To change the name, select a name from the list or
enter the name directly in the edit field.
When Simulink® software compiles the model containing this block,
Simulink 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 a Simulink.Signal
object
having the same name. See Symbol Resolution for more
information about the search path.
If Simulink 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 of 0
. If
Simulink software finds neither the Data Store
Memory block nor the signal object, it halts the compilation
and displays an error.
Block Parameter:
DataStoreName |
Type: character vector |
Values: data store name |
Default:
'A' |
Data store memory block
— Data Store Memory block nameThis field lists the Data Store Memory block that initialized the store from which this block reads.
Data store write blocks
— Corresponding Data Store Write blocksThis field lists the path to all 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. Click any entry in this list to highlight the corresponding block in your model.
Sample time
— Sample timeThe 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.
Block Parameter:
SampleTime |
Type: character vector |
Values: scalar | vector |
Default:
'-1' |
Elements in the array (Signals in the bus)
— Elements in the associated data storeList of elements in the associated data store. For data stores containing arrays, you can read the whole data store, or you can specify one or more elements of the data store. For bus signals, lists the elements in the associated data store. The list displays the maximum dimensions for each element, in parentheses.
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 elements that you want to select for reading. Then click Select>>.
To refresh the display and reflect modifications to the array or bus used in the data store, click Refresh.
The prompt for this section (Elements in the array or Signals in the bus) depends on the type of data in the data store.
Block Parameter:
DataStoreElements |
Type: character vector |
Values: pound-delimited list of elements (See Specification using the command line.) |
Default:
'' |
Specify element(s) to select
— MATLAB expression defining the elements to selectEnter a MATLAB expression to define the specific element that you want to
read. For example, for a data store named DSM
that
has maximum dimensions of [3,5]
, you could enter
expressions such as DSM(2,4)
or DSM([1
3],2)
in the edit box and then click
Select>>.
To apply the element selection, click OK or Apply.
Block Parameter:
DataStoreElements |
Type: character vector |
Values: pound-delimited list of elements (See Specification using the command line.) |
Default:
'' |
Selected element(s)
— List of selected elementsDisplays the elements that you select from the data store. 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.
Block Parameter:
DataStoreElements |
Type: character vector |
Values: pound-delimited list of elements (See Specification using the command line.) |
Default:
'' |
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|