CodeGen Error using Grouped custom storage classes (struct / bitfield) with referenced model
古いコメントを表示
I recieve the following error when trying to codegen with embedded coder:
Error: Simulink Coder Error: Invalid DataScope 'Exported' for custom storage class: Struct
Grouped custom storage classes must be Imported when used with referenced models.
Is there a way to codegen a model that contains a referenced model using custom storage classes (bitfield / struct)?
採用された回答
その他の回答 (1 件)
Mark McBroom
2024 年 2 月 28 日
1 投票
As the error message indicates, you must write the header file by hand that defines the C structure, and then set the struct storage class to be imported and provide the name of the hand-written header file.
A more mainstream solution is to define a Simulink.Bus rather than a struct storage class. Simulink Buses are fully supported by referenced models.
1 件のコメント
Jake Gareau
2024 年 3 月 7 日
編集済み: Jake Gareau
2024 年 3 月 7 日
カテゴリ
ヘルプ センター および File Exchange で Event Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
