How to avoid 'potential conflicting usages of identifier' error in simulink?

18 次查看(过去 30 天)
Hi,
I have the code generation toolbox installed. I have some variables defined as ExportedGlobal in a block. When I replicate that block in different parts of my model, simulink complains about 'potential conflicting usages'. I discovered that you need to turn off the 'ExportedGlobal' storage class from all variables to avoid that problem, but it is cumbersome to have to do this every time. I would think that the ExportedGlobal should only be meaningful when you are actually generating code and I'm just simulating in Normal mode. Is there an easier workaround than changing the Storage class for all variables every time?

回答(1 个)

Kausthub
Kausthub 2024-1-23
Hi Romang ,
I understand that you would like to name the variables as “ExportedGlobal” which results in a naming conflict error due to a storage class with the same name. To overcome this error, you do not have to update each variable’s storage class instead you could enable “Ignore Custom Storage Classes” option which is available at Configuration Parameters -> Interface -> Ignore Custom Storage Classes.
You could also refer to this post by MathWorks Support which addresses you exact query:
Hope it helps!

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by