Replacing RTW types with actual C-style types

I am new to the code generation capabilities of Simulink and have been working with both Simulink Coder and Embedded Coder. So, far I have been able to get the model to compile and running but I am not a huge fan of the embedded coder types. Is there a way to have the embedded coder put the standard C-types in there? It obvously knows what they should be as it typedefs them in the rtwtypes.h but this just seems redundant to me.
Thanks.

 採用された回答

TAB
TAB 2012 年 8 月 9 日
編集済み: TAB 2012 年 8 月 9 日

1 投票

You can not replace the datatype names generated by embedded coder with C-style type names.
But, if you don't like the type name generated by embedded coder (I think MISRA standard in not your friend), you can configure the embedded coder to replace the type names with your own type names.
For example you can configure embedded coder to generate My_u16 instead of uint16_T for unsigned int.
See Data Type Replacement pane in configuration window. Apart from this setting you need resolve the each type names with Simulink.AliasType object created in base workspace.

2 件のコメント

craq
craq 2016 年 6 月 15 日
I wish I were allowed to replace uint16_T with uint16_t or real_T with double, and then dispense with rtwtypes.h altogether. But Simulink complains that "double is a C keyword and cannot be used as a replacement type."
Danijel Domazet
Danijel Domazet 2020 年 4 月 21 日
Hi,
You say "Apart from this setting you need resolve the each type names with Simulink.AliasType object created in base workspace."
How do I do that? How do I add Simuling.AliasType?
Thank you!

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2012 年 8 月 8 日

コメント済み:

2020 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by