Simulink Coder- Tunable Constants Question

Hi,
The code generated out of Simulink looks a bit off. I am trying to globally expose the following variable. (eventually will be a larger structure).
In the header file, the struct is defined as
/* Parameters (auto storage) */
struct Parameters_CompileAttemp_201107_ {
real_T TESTING; /* Variable: TESTING
* Referenced by: '<S4>/Constant8'
*/
};
But the parameter refers the struct as: extern Parameters_CompileAttemp_201107 CompileAttemp_20110705_P;
The struct type name in the definition does not match the with the one referenced in the parameter: Parameters_CompileAttemp_201107 Parameters_CompileAttemp_201107_
Can someone help with the slight difference?
thanks, Becky

댓글 수: 1

Kaustubha Govind
Kaustubha Govind 2011년 7월 22일
Becky: Does the generated code fail to compile? If it does compile, perhaps there is a typedef or #define somewhere that reconciles the difference?

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

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 7월 22일

0 개 추천

extern Parameters_CompileAttemp_201107 CompileAttemp_20110705_P_
It declares a variable called "CompileAttemp_20110705_P_". Its type is "Parameters_CompileAttemp_201107".

댓글 수: 2

B. J.
B. J. 2011년 7월 22일
Hi Fangjun,
Let me clafiry,
Parameters_CompileAttemp_201107_ is the name of struct type
CompileAttemp_20110705_P is variable name
not CompileAttemp_20110705_P_
Essentially, the code is correct except I need to remove the '_' at the end. I'm confused why the Simulink Compiler would add this.
Fangjun Jiang
Fangjun Jiang 2011년 7월 22일
Without your modification, does the auto-gen code compile? You are not supposed to hand-modify the auto-gen code.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

질문:

2011년 7월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by