MATLAB: How to implement a Data Storage Read with Model Reference blocks that are executed at different sample rates in Simulink 6.3 (R14SP3)

memorymodelmultipleratesreferencereferencingsamplesimulink

When I use the Data Store Read with Model reference that are executed at different sample rates (see attached model testEDGerror.mdl), I obtain the following error message:
In model 'testEDGreferror', one or more of the blocks that reference a global data store defined by the global Simulink.Signal object 'A' execute in a task whose sample time is [0.1 0], yet one or more blocks of model 'testEDGref2' reference that data store with sample time [1 0]. Blocks accessing global data stores in multiple models must all execute in a single, common task.

Best Answer

If you want to use global data store and access the global data store at different sample rates, you need to place one of the Data Storage Read block outside the Model Reference block.
You can input the signal from the Data Store Read block to the Model Reference block and use a Signal Conversion block (which converts the signal to a new type without altering the signal values) inside the Model Reference Block. Find attached the model testEDG.mdl that shows how this is implemented.
This approach does not guarantee data integrity. In order to guarantee data integrity, you may want to consider using a Rate Transition block and check the parameters boxes of “Ensure data integrity during data transfer” and “Ensure deterministic data transfer (maximum delay)” options. The model testEDG.mdl also shows how this option is implemented.