Data Store Memory - Define data store

Library

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 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:

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.

Data Type Support

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®.

Parameters and Dialog Box

The Main pane of the Data Store Memory block dialog appears as follows:

Data store name

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.

Corresponding Data Store Read blocks

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.

Initial value

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.

Data store must resolve to Simulink signal object

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:

See Block State Storage and Interfacing in the Real-Time Workshop® documentation for more information.

Interpret vector parameters as 1-D

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:

Minimum

Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:

Maximum

Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:

Data type

Specify the output data type. You can set it to:

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.

Signal type

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:

Detect read before write

The model is attempting to read data from this data store without having previously written data into the store in the current time step.

Detect write after read

The model is attempting to store data in this data store after previously reading data from it in the current time step.

Detect write after write

The model is attempting to store data in this data store twice in succession in the current time step.

Characteristics

Sample Time

N/A

Dimensionalized

Yes

Multidimensionalized

Yes

See Also

Data Store Read, Data Store Write

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS