Embedded Coder shall use an externally implemented nested struct for read and write access (in place) in it's generated code which is written in C.
26 ビュー (過去 30 日間)
古いコメントを表示
I want to use an existing nested struct which is originally implemented in an external software project written in C to be used by Simulink.
The Embedded Coder shall generate code that accesses internal elements of that struct through an external variable "myNestedStructVar" of that nested struct type.
The Embedded Coder shall not run the access (especially for write) through a copy of "myNestedStructVar" into a second struct but use the one and only "myNestedStructVar".
When the bus assignment is used the Embedded Coder generates a copy of the variable, writes into the element of interest and copies the whole content back to "myNestedStructVar". So no assignment in place.
The generated code is used by the external software.
I can't figure out how to solve that task.
2 件のコメント
Sahas
2024 年 10 月 23 日 7:06
Can you please elaborate what do you mean by this part The Embedded Coder shall generate code that accesses internal elements of that struct
and this part,
When the bus assignment is used the Embedded Coder generates a copy of the variable, writes into the element of interest and copies the whole content back to "myNestedStructVar". So no assignment in place.
It will help me assist you better.
回答 (1 件)
Mark McBroom
2024 年 11 月 2 日 21:03
A couple of ideas.
- It sounds like the functional call sub-system is set to be reusable. Try to make it non-reusable. Follow these steps except instead of selecting "inline" select "non-reuslable". https://www.mathworks.com/help/rtw/ug/inline-subsystem-code-ecoder.html#
- You could also use data store read/write blocks inside the function call subsystem.
参考
カテゴリ
Help Center および File Exchange で Deployment, Integration, and Supported Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!