Hi,
I have a model consisting of many models created by different authors inserted using the a ModelReference block.
The Model simulates fine in normal mode, but when I generate code for Accelerated mode or Realtime Target I get the following error.
### Build procedure for model: 'FS_HUD2_004FUN' aborted due to an error.Potential conflicting usages of identifier 'DISABLE': an enumeration string in data type'enm_CFG_TSR', and an enumeration string in data type 'enm_CFG_NAVIGATION'
We have a large number of custom enumerations across all the models (many have a enumeration 'DISABLE'/'ENABLE'/'ERROR' etc), but the two in this example are:
classdef enm_CFG_TSR < Simulink.IntEnumType enumeration DISABLE(0), ENABLE(1), endend
and
classdef enm_CFG_NAVIGATION < Simulink.IntEnumType enumeration DISABLE(0), ENABLE(1), endend
In normal mode I have no issues as the State Charts that use them, use full definitions on their transitions for example:
[IPCHUDMenuTSRReq == 1 ...&& IPCHUDMenuTSRReq_frsh == 1 ...&& CFG_TSR == enm_CFG_TSR.ENABLE]
Is there a way to get the compiler to generate unique enumerations in the generated code automatically. As I would like to avoid manually renaming to ensure that there are no duplications as this will be very time consuming, and additionally lead to enumerations that look something like below, which I understand is frowned upon:
classdef enm_CFG_NAVIGATION < Simulink.IntEnumType enumeration CFG_NAVIGATION_DISABLE(0), CFG_NAVIGATION_ENABLE(1), end end
Any tips or advice greatly appreciated.
Best Answer