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.
6 views (last 30 days)
Show older comments
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 Comments
Sahas
on 23 Oct 2024
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.
Answers (1)
Mark McBroom
on 2 Nov 2024
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.
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!