| Contents | Index |
| On this page… |
|---|
To use a Data Store Memory block to define a data store, drag an instance of the block into the model at the topmost level from which you want the data store to be visible. The result is a local data store, which is not accessible within referenced models.
To define a data store that is visible at every level within a given model, except within Model blocks, drag the Data Store Memory block into the root level of the model.
To define a data store that is visible only within a particular subsystem and the subsystems that it contains, but not within Model blocks, drag the Data Store Memory block into the subsystem.
Once you have added the Data Store Memory block, use its parameters dialog box to define the data store's properties. The Data store name property specifies the name to of the data store that the Data Store Write and Data Store Read blocks access. See Data Store Memory documentation for details.
You can specify data store properties beyond those definable with Data Store Memory block parameters by selecting the Data store name must resolve to Simulink signal object option and using a signal object as the data store name. See Specifying Attributes Using a Signal Object for details.
A Data Store Memory block can inherit three data attributes from its corresponding Data Store Read and Data Store Write blocks. The inheritable attributes are:
Data type
Complexity
Sample time
However, allowing these attributes to be inherited can cause unexpected results that can be difficult to debug. To prevent such errors, use the Data Store Memory block dialog or a Simulink.Signal object to specify the attributes explicitly.
You can use the Data Store Memory block dialog box to specify the data type and complexity of a data store. In the next figure, the dialog box sets the Data type to uint16 and the Signal type to real.

You can use a Simulink.Signal object to specify data store attributes. To establish an implicit data store, as described in Defining Data Stores with Signal Objects, use the same general approach as when you explicitly associate a data object with a Data Store Memory block.
The next figure shows a Data Store Memory block named A that specifies resolution to a Simulink.Signal object, named A. To use a signal object for the data store, select the Data store name must resolve to Simulink signal object parameter and set Data store name to the name of the signal object.

The signal object specifies values for all three data attributes that the data store would otherwise inherit: DataType, Complexity, and SampleTime. In this example, the Simulink.Signal object A might have the following properties:
A =
Simulink.Signal (handle)
RTWInfo: [1x1 Simulink.SignalRTWInfo]
Description: ''
DataType: 'auto'
Min: []
Max: []
DocUnits: ''
Dimensions: 1
DimensionsMode: 'auto'
Complexity: 'auto'
SampleTime: -1
SamplingMode: 'auto'
InitialValue: ''
![]() | About Data Stores | Defining Data Stores with Signal Objects | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |