what's a externally defined MCOS class ?
79 views (last 30 days)
I am getting this error while runing a test on testManager 'You must remove the externally defined MCOS class before you can use the dictionary definition'. I don't know what are MCOS class, and how do I remove one ?
Brian Kim on 27 Mar 2020
The root cause of this message is most likely that the enumeration is first defined programmatically (e.g. 'Simulink.defineIntEnumType') and Simulink then attempts to redefine it when loading a model linked to a data dictionary which contains a second enumeration definition.
In order to prevent these issues, you may wish to employ the following commands:
This will clear enum definitions created by the "Simulink.defineIntEnumType" command.
This will close connections to data dictionaries that are presently open. If a data dictionary contains an enum definition, closing the dictionary will attempt to release this enum definition from memory.
For additional information related to these functions please reference the following documentation pages:
Yujin Yi on 19 Nov 2021
In my case, I am using the MATLAB2019b version, and the same error occurred while testing using the Harness model.
I removed the harness model from the matlab project path and the problem was solved.
Samir Revelo on 20 Jan 2020
I´m getting the same error after upgrading my Simulink project from matlab version r2018b to r2019b.
Would be very helpful if Matlab support can give any hint about the issue.
Zhenwei Sun on 29 Jan 2021
i get this issue in 2019a,Would be very helpful anyone have fix this?
Paul Huang on 8 Sep 2021
Just called MathWorks Tech Support and not much help. They can only provide whatever they found in their documents. In my case, the issue is with the simulink data dictionary, which is the worse design I ever seen.
In my case, Simulink.clearIntEnumType and Simulink.data.dictionary.closeAll don't work. I am not sure if the reason is that my data dictionary is from 19a but I am using 19b. I had hard time to find a way to convert the data dictionary to 19b. Therefore, I decided to get rid of the data dictionary completely and define the MCOS enum type in m file. Basically, I define the enum type instead of Simulink does it for me. After converting the dictionary to a mat file and create the m-files for all the enum type, the error is gone.