필터 지우기
필터 지우기

Simulink signal Code generation property

조회 수: 4 (최근 30일)
Suleyman
Suleyman 2024년 1월 29일
댓글: Brahmadev 2024년 2월 7일
I am unable to set an exported global storage class for simulink signal under of Signal property window. In 2019, i can select from code generation under signal property but its removed from 2020b. I'm using autosar blockset and
mysignal.CoderInfo.StorageClass = 'ExportedGlobal';
or code mapping are not helping me because of the target selection. How Can i set signal as a global in AUTOSAR target 2020b

채택된 답변

Brahmadev
Brahmadev 2024년 2월 6일
편집: Brahmadev 2024년 2월 6일
As you mentioned, 'ExportedGlobal' is not present in the 'Code Mappings - Component Interface' for Signals/States Data store. Instead, you can define 'Mapped To' as 'StaticMemory' for any signal that you would want to be static in the generated code.
Also, notice in the screenshot below that the generated code allocates memory for the error signal outside the model step function.
You can refer to the following MathWorks documentation links for more information:
  1. Configure AUTOSAR Static Memory: https://www.mathworks.com/help/autosar/ug/configure-autosar-static-memory.html
  2. Map AUTOSAR Elements for Code Generation: https://www.mathworks.com/help/autosar/ug/map-model-elements-using-simulink-autosar-mapping-explorer.html
Hope this helps in resolving your query!
  댓글 수: 2
Suleyman
Suleyman 2024년 2월 6일
its look works. I wanna ask about is there any difference in using export global and static memory mapping?
Brahmadev
Brahmadev 2024년 2월 7일

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Infinite_king
Infinite_king 2024년 2월 5일
Hi Suleyman,
In R2020b, you can set the storage class of a signal using the Code Mapping Editor. Follow the steps below to open the editor and set the storage class for a signal.
  • In the C Code Tab, select Code Interface -> Default Code Mappings.
  • This will open a Code Mapping Editor.
  • In the editor, click on Signals/States tab.
  • Select the signal for which you want to change the storage class.
  • Click the 'Add selected signals to code mappings' button. (below the Data Defaults tab)
  • Here you can change the storage class of that signal.
  댓글 수: 1
Suleyman
Suleyman 2024년 2월 5일
Yeah Its presented on simulink coder but not presented AUTOSAR code mappings.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 AUTOSAR Blockset에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by