Simulink Reference Previous page   Next Page
Data Store Write

Write data to a data store

Library

Signal Routing

Description

The Data Store Write block copies the value at its input to the named data store.

Each write operation performed by a Data Store Write block writes over the data store, replacing the previous contents.

The data store to which this block writes is determined by the location of the Data Store Memory or signal object that defines the data store. For more information, see Working with Data Stores and Data Store Memory. The size of the data store is set by the signal object or the Data Store Memory block that defines and initializes the data store. Each Data Store Write block that writes to that data store must write the same amount of data.

More than one Data Store Write block can write to the same data store. However, if two Data Store Write blocks attempt to write to the same data store during the same simulation step, results are unpredictable.

Data Type Support

The Data Store Write block accepts a real or complex signal of any data type supported by Simulink, including fixed-point data types.

For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.

Parameters and Dialog Box

Data store name
Specifies the name of the data store to which this block writes 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 Write block or at higher levels. To change the name, select a name from the pull-down list or enter the name directly in the edit field.
When Simulink 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 does not find such a block, it searches the model workspace and the MATLAB workspace for a Simulink.Signal object having the same name. 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 finds neither the Data Store Memory block nor the signal object, it halts the compilation and displays an error.
Data store memory block
This field lists the Data Store Memory block that initialized the store to which this block writes.
Data store read blocks
This parameter lists all the Data Store Read 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.
Sample time
Specify the sample time that controls when the block writes to the data store. A value of -1 indicates that the sample time is inherited. See Specifying Sample Time in the online documentation for more information.

Characteristics

Sample Time
Specified in the Sample time parameter
Dimensionalized
Yes

See Also

Data Store Memory, Data Store Read


Previous page  Data Store Read Data Type Conversion Next page

© 1994-2005 The MathWorks, Inc.