Borrar filtros
Borrar filtros

How to pre-populate a data store with timeseries data rather than just Initial Value

6 visualizaciones (últimos 30 días)
Hello,
I have a simulink model which requires the use of data store read/write blocks.
Normally, the read blocks will read from a data store that is being written-to from another part of the model.
However, for modular testing purposes, sometimes some of the data store write blocks are not available.
In this case, I would like to be able to pre-populate the data store with timeseries data for the whole simulation (rather than just setting the initial value).
Note that I am creating the data store with Simulink.Signal objects in the base workspace (not using data store memory blocks)
I know that I could temporarily replace the data store read block with a block such as From Workspace.
However, this is not an ideal solution because it would be a very manual process to find and replace all of Data Store Read blocks back and forth between testing and production every time, and using variant switches or similar would add alot of clutter.
Any suggestions would be greatly appreciated!
Many thanks in advance.

Respuestas (1)

Akshat Dalal
Akshat Dalal el 13 de Sept. de 2023
Hi Matthew,
I understand you want to pre-populate a data store with timeseries data for the entire simulation in Simulink. To do so, create a harness for your model and override the Data Store Read blocks with signal objects containing the desired timeseries data. Save the harness and run the simulation to use the pre-populated data throughout. This approach eliminates manual block replacement and ensures the data store is populated with the desired information.
You can use the ‘From Workspace’ block to replace the Data Store Read block by importing the timeseries data into this block from the Base Workspace. You could refer to the following documentation to learn more - https://in.mathworks.com/help/releases/R2021b/simulink/slref/fromworkspace.html

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by