Simulink , data store memory, different value of reading/writing
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
JACK DENG
am 17 Apr. 2021
Kommentiert: JACK DENG
am 21 Apr. 2021
hi, all
Currently I meet one question.
i have an parameter: tmptr is constant, 25degC.
as this two picture, picture1 is in sub-system#1, picture2 is in sub-system#2.
- data store writing is ok, all time tmptr is 25.
- data store reading is some wrong, after reading, temp is 0degC in begining.
Also I have tried do writing/ reading in same sub-system, value is right,
why is it? look forward your answer, thanks.
picture1
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/586591/image.png)
picture2
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/586596/image.png)
Regards
Jack
0 Kommentare
Akzeptierte Antwort
Aghamarsh Varanasi
am 20 Apr. 2021
Hi Jack,
I see that there is a small time gap before the Data-Store Read block 'reads' the data from the data store memory. This is because there might be a Read operation from the DataStore Read block, before the Write operation from the DataStore Write block.
To check if this is the issue in your model,
1. You can turn the parameter 'Detect Read before Right' in the Model Configuration Parameters > Diagnostics > Data Validity > Data Store Memory block pane, to 'error' out. This configuration is set to 'warning' by default.
2. You can see the order in which the blocks are executed using the Execution Order under Information Overlay in the Debug tab in Simulink toolstrip.
To overcome this issue, some of the workarounds are:
Hope this helps.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!