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

31 views (last 30 days)
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?

Answers (1)

Kausthub
Kausthub on 23 Jan 2024
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!

Community Treasure Hunt

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

Start Hunting!