How to reduce the number of global variables in the generated code?

조회 수: 6 (최근 30일)
Rusczak
Rusczak 2017년 6월 28일
편집: Birdman 2017년 10월 18일
Hi,
I'm currently generating C code using Simulink Coder and one thing that makes it complicate to integrate with my application is the amount of random Global structures that it creates. Even for inputs or outputs it is creating copies in globals.
Can anybody recommend techniques to reduce this?
thanks

채택된 답변

Birdman
Birdman 2017년 10월 18일
편집: Birdman 2017년 10월 18일
You can make the inputs and outpus define as struct which are stored in .h files. For this purpose, go to Configuration Parameters-Code Generation-Interface and there is a subsection called Code interface packaging. Select Reusable function and for Pass root level I/O as Structure Reference. Hope this helps.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by