Simulink.SimulationData.DataStoreMemory - Container for data store logging information - MATLAB (original) (raw)

Main Content

Container for data store logging information

Description

Simulink.SimulationData.DataStoreMemory objects store logging information from Data Store Memory blocks during simulation.DataStoreMemory objects contain information about the blocks that write to the data store.

Creation

When a model is configured to log data stores, simulating that model creates aSimulink.SimulationData.DataStoreMemory object for each Data Store Memory block that is configured for logging.

Syntax

Description

`dsmobj` = Simulink.SimulationData.DataStoreMemory creates an empty Simulink.SimulationData.DataStoreMemory object.

example

Properties

expand all

Name of DataStoreMemory object to use for name-based access, specified as a string or character vector.

Scope of data store, specified as "local" or"global".

This property is read-only.

Block path of blocks that write to the data store, specified as a vector ofSimulink.SimulationData.BlockPath objects. Each element of the vector contains the full block path of one writer block.

This property is read-only.

Number of writes in data store, specified as an integer vector.

The _n_th element of DSMWriters contains the index of the element in DSMWriterBLockPaths that contains the block path of the writer that performs the _n_th write toValues.

Logged time and data, specified as a timeseries object.

Examples

collapse all

The simpleDSM model contains a Data Store Memory block that defines and initializes the data store named A and is configured for logging. The model also contains a Sine Wave block connected to a Data Store Write block that writes to data store A. Data store logging is enabled for the model. When you simulate a model with logged data stores, the software saves data store data in one or more Simulink.SimulationData.DataStoreMemory objects.

Open the model. Then, simulate the model.

mdl = "simpleDSM"; open_system(mdl) out = sim(mdl);

The simpleDSM model

Simulation output is grouped into a Simulink.SimulationOutput object named out. Logged data store data is stored as a property of the SimulationOutput object with the default name dsmout.

out = Simulink.SimulationOutput:

             dsmout: [1x1 Simulink.SimulationData.Dataset] 
               tout: [51x1 double] 

 SimulationMetadata: [1x1 Simulink.SimulationMetadata] 
       ErrorMessage: [0x0 char] 

To access the Simulink.SimulationData.Dataset object that contains data store data, use dot notation.

dsmData = Simulink.SimulationData.Dataset 'dsmout' with 1 element

                              Name  BlockPath                   
                              ____  ___________________________ 
1  [1x1 DataStoreMemory]      A     simpleDSM/Data Store Memory

Use braces to access the Simulink.SimulationData.DataStoreMemory object that contains logging information from the Data Store Memory block.

dsm = Simulink.SimulationData.DataStoreMemory Package: Simulink.SimulationData

Properties: Name: 'A' BlockPath: [1×1 Simulink.SimulationData.BlockPath] Scope: 'local' DSMWriterBlockPaths: [1×1 Simulink.SimulationData.BlockPath] DSMWriters: [51×1 uint32] Values: [1×1 timeseries]

Methods, Superclasses

Version History

Introduced in R2011a