Simulink , data store memory, different value of reading/writing

1 次查看(过去 30 天)
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
picture2
Regards
Jack

采纳的回答

Aghamarsh Varanasi
Aghamarsh Varanasi 2021-4-20
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.
More info can be found here.
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.
More info can be found in this documentation page.
To overcome this issue, some of the workarounds are:
This documentation page contains the possible workarounds.
Hope this helps.
  1 个评论
JACK DENG
JACK DENG 2021-4-21
Hi, Aghamarsh
thanks your reply. based on your advice, i have checked model, this issue is caused executing order. now the model is ok. thanks.
Regards
Jack

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by