- clicking on 3 dots on the bottom right on the simulink canvas or
- From the tool strip click on Code Interface --> code mappings
How to set the scope of C + + code generated by datastore module to public?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
By default, the scope of the variables generated by the datastore module is private. how can I modify the model to make the scope of the generated variables to public?
0 Kommentare
Antworten (1)
Harshit Desai
am 17 Mär. 2021
Bearbeitet: Harshit Desai
am 18 Mär. 2021
I understand that you are trying to make the data store module scope public in the generated code and I am assuming you are using R2020b or before.
Until MATLAB R2020b, the code mapping for Target language C++ was not supported.
But from MATLAB 2021a, MathWorks product Embedded Coder is supporting Code mapping for C++. So if you like you can upgrade to R2021a. But if upgrading isnt an option, then this limitation would exist.
But if you do upgrade then :
This tool lets you customize the generated code by changing the data visibility and member access functions.
You can find more Information on this MathWorks documentation page --> https://www.mathworks.com/help///ecoder/ref/codemappingsceditor.html
To Answer your question.
You can change the scope of the variables by opening the code mappings pane by
Then you can select in the Data Tab --> Signals, state and internal data and change the visibility to public.
1 Kommentar
Siehe auch
Kategorien
Mehr zu Code Interface Definitions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!