From: G?kcan AKALIN on
I have some problems with the behaviour of Simulink during minor time steps for continuos solvers. The problem is related with Data Store blocks. General structure of the problematic model is as such:
A is the data store name
Data Store Read Block of A->Switch-Case->Various Switch Case Action Subsystems(There are other read and write operations of data store blocks unrelated with A)->All output signals merged-> Output is written to Data Store Write Block of A
All data store diagnostics are on, so i can ensure the order of read and write procedure for Data Store Block A.
What i try to achive is the execution of proper subsystems with respect to the number stored in A. However, after inspecting the information supplied by data store diagnostics ; it is seen that during minor time steps the output of Switch-Case block or the value of data store block A is treated as fixed. From data store diagnostics information,i can determine which Switch Case Action Subsystem is being executed during the corresponding minor time step by reading data store diagnostics information corresponding to that specific subsystem read write operations.
If i try to explain my problem with a simple example:
Let’s say for
A=1 ->Switch Case Action Subsystem 1
A=2 ->Switch Case Action Subsystem 2
A=3 ->Switch Case Action Subsystem 3
A=4 ->Switch Case Action Subsystem 4
Outputs of Switch Case Action Subsystems are merged.
During a minor time step:
Switch Case Action Subsystem 1 takes the value of A by an input port. In Switch Case Action Subsystem 1, i add 1 to input port value (A) and send it by output port of Switch Case Action Subsystem 1. As the last operation, the merged signal (A+1) is written into data store block A (can be confirmed by data store diagnostics).
The next minor time step:
In this minor time step, i expect Switch Case Action Subsystem 2 to be executed. However as if A is still 1, Switch Case Action Subsystem 1 is executed again.
The next minor time step:
Switch Case Action Subsystem 1 is executed again.
[Here i assume that i must have done a mistake about the modification of input value (A) or writing the merged output value to Data Store Block A]
The next (major) time step:
In this time step, I expect Switch Case Action Subsystem 1 to be executed again ; because i am very close to the conclusion that i must have done a mistake changing the input port value in Switch Case Action Subsystem 1.
However, i see that Switch Case Action Subsystem 4 is executed in this major time step!!!
[Conclusions i can reach with this information:
-Modified value of A is stored in Data Store Block A in minor time steps as expected; but the output of Data Store Block A (output of Data Store Read Block of A) is to be updated at only major time steps??? ( A->A+1->A+2->A+3)
- Switch-Case Block (not Switch Case Action Subsystems ) output is to be updated at only major time steps???
-None of above is true, more information about minor time step procedure is required. ?]
Thanks for reading...

GA