Main Content

Data Stores

R2026b
Define global values for multiple signals at different levels of a model

A large model can require individual signals to route to many separate blocks in different locations in the diagram. You can configure a data store to allow access to signal data from anywhere in a model, similar to a global variable in a computer program. However, as with global variables, data stores can reduce model transparency and make model verification more difficult. To decide whether to use a data store, see Data Store Basics.

To route signals across large models, consider using Goto and From blocks instead of data stores.

Blocks

Data Store Memory blockData Store MemoryDefine data store
Data Store Read blockData Store ReadRead data from data store
Data Store Write blockData Store WriteWrite data to data store

Classes

Simulink.SimulationData.DataStoreMemoryContainer for data store logging information
Simulink.SimulationData.BlockPathFully specified block path
Simulink.SimulationData.DatasetAccess logged simulation data or group simulation input data

Objects

Simulink.DataStoreSpecify instance-specific properties of data store (Since R2026b)

Model Settings

expand all

Detect read before writeDiagnostic action to take if model reads from data store before writing to that data store in current time step
Detect write after readDiagnostic action to take if model writes to data store after reading from data store in current time step
Detect write after writeDiagnostic action to take if model writes to data store twice in current time step
Multitask data storeDiagnostic action to take when task reads from data store to which another task writes
Duplicate data store namesDiagnostic action to take if model contains multiple data stores with same name

Topics

Featured Examples