Why does Simulink compilation fail with 'Potential conflicts' when using Data Store blocks and Data Dictionaries?

15 次查看(过去 30 天)
I have a model in which I use a Data Store Memory block to define a 'Temp' variable. This variable is also defined in a Data Dictionary, such that I can share it with a referenced model. I use Data Store Write inside the reference model and Data Store Read in the main model. 
Whenever I try to update or simulate the model, I get the following error:
 
        Potential conflicting usages of identifier 'Temp': the data store associated with the block 'test_error/main_system/Data Store Memory', and a global data store memory 'Temp'
How do I fix this?

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2024-8-29
The issue arises because there is a clash between a global and a local data store. The Simulink.Signal object 'Temp' in the Data Dictionary defines a global Data Store because it can be accessed by all models in the hierarchy. Thus, the Data Store Memory block in the main model is now redundant because it also declares a local data store named 'Temp'.
You can find more information about the creation and application of Data Stores on the following page of the documentation page:
Please run the below command in the command window of installed MATLAB R2019a version to get release specific documentation
>> web(fullfile(docroot, 'simulink/ug/model-global-data-using-data-stores.html'))
In particular, the final sentence of the section 'Create and Apply Data Stores' should clarify this issue. 
To resolve the error and continue with the simulation, you can remove the Data Store Memory block, and then Simulink will automatically read and write to the 'Temp' variable defined in the Data Dictionary. You will notice that the Data Store Read and Write blocks will show that 'Temp' is a global Data Store.
Please follow the below link to search for the required information regarding the current release:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Model Editing 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by