what's a externally defined MCOS class ?

조회 수: 73 (최근 30일)
loubna ibnou fairouze
loubna ibnou fairouze 2019년 12월 6일
편집: Petr75661 2022년 6월 9일
Hello all,
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 ?
Best regards.
Loubna.
  댓글 수: 1
Petr75661
Petr75661 2022년 6월 9일
편집: Petr75661 2022년 6월 9일
This is a bug in Matlab R2019b. If your data dictionary contains any enum definition, Simulink will throw this error if you repeatedly open+sim+close a schematic with this data dictionary within one function. As a workaround, we call another sub-function which executes the open+sim+close sequence only on one schematic and returns. This bug is unique to R2019b and does not affect R2019a, R2020a, R2020b, R2021a, R2021b, R2022a.

댓글을 달려면 로그인하십시오.

답변 (8개)

Jin-seok Jeong
Jin-seok Jeong 2020년 2월 29일
편집: Jin-seok Jeong 2020년 2월 29일
I have the same problem.
In my case, the error was due to the enumerated type defined in data dictionary.
But there was no problem in 2018b.
I have no idea why the mcos class error occurs in 2019b.
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2020년 3월 2일
편집: Sean de Wolski 2020년 3월 2일
Please contact tech support. This is a public forum.

댓글을 달려면 로그인하십시오.


Brian Kim
Brian Kim 2020년 3월 27일
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:
>> Simulink.clearIntEnumType
This will clear enum definitions created by the "Simulink.defineIntEnumType" command.
>> Simulink.data.dictionary.closeAll
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:
  댓글 수: 1
Gokul
Gokul 2020년 5월 25일
편집: Gokul 2020년 5월 25일
Hello,
I tried the function "Simulink.clearIntEnumType" on R2019b, to get rid of this MCOS error. But it seems to be unable to remove and gives the following Warning:
>> Simulink.clearIntEnumType
Warning: Cannot clear class 'AStype' because instances of the class still exist.
Could you suggest how can I clear this, without closing and restarting Matlab?
Note: The data dictionary/models are all already closed

댓글을 달려면 로그인하십시오.


Oleksandr Pylypenko
Oleksandr Pylypenko 2020년 3월 23일
I get this error when moved all model data(with enum) to data dictionary, but in the matlab memory that define was saved. In the end I had two definition of enum. In order to delete enum from matlab memory run this command: Simulink.clearIntEnumType()

Paul Huang
Paul Huang 2021년 9월 8일
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.

Yujin Yi
Yujin Yi 2021년 11월 19일
Hello
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
Samir Revelo 2020년 1월 20일
Hello,
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.

Sean de Wolski
Sean de Wolski 2020년 2월 10일
I'd contact tech support on that one.

Zhenwei Sun
Zhenwei Sun 2021년 1월 29일
hello,
i get this issue in 2019a,Would be very helpful anyone have fix this?

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by