RTWCGEmlParse Error while trying to generate code in Simulink

Hello,
I am trying to generate code from my simulink file but I get an error just after starting build procedure (at 0.507sec) : "RTWCGEmlParse Error : Compilation errors when generating code.
Component : Simulink | Category : Model error"
After that, all the blocks become yellow and red. I guess that RTW stands for Real-Time Workshop, the previous name of Simulink Coder and that CG stands for Code Generator but I have no idea what this error means and there is no further explanation. My simulink file contains Simulink blocks and a Stateflow chart.
Could you help me please?
I am using Matlab r2014a.
Thank you

3 件のコメント

Anup
Anup 2015 年 5 月 20 日
Getting the same error, have you managed to resolve it?
Niels
Niels 2015 年 5 月 21 日
Yes, by deleting each block one by one in order to find the guilty one, I've found that the Gain block doesn't like matrix sum and product as values :
I had 3 gain blocks with a gain value of A+B*K (where A, B and K are 3 matrix). So I created a new matrix in the workspace : Anew=A+B*K and replaced the values of the gain blocks by Anew and it worked ! No more errors :)
Hope it will help ;)
mario alejandro
mario alejandro 2019 年 5 月 2 日
Thank you, friend, I see that you solved it quickly and yourself. It has helped me a lot

サインインしてコメントする。

回答 (1 件)

Anup
Anup 2015 年 5 月 21 日

0 投票

My issue seemed to be with the use of nested library blocks. I ended up replacing the inner library block with its implementation. So I still have the same functionality but the interface and model looks a bit different.

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

質問済み:

2015 年 4 月 16 日

コメント済み:

2019 年 5 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by