using "modele reference" with RTW

조회 수: 2 (최근 30일)
Fabien
Fabien 2011년 2월 9일
Hello
sorry for my not really fluent english
here is my problem :
I create a simple model with simulink "model.mdl"
"inline parameters" is true and "ModelReferenceCompliant" is on
I create a simple model "test.mdl" using "model.mdl" with block "modele reference"
boths model RTW target file are"igc.tlc" (owner target)
when I build "test.mdl" I have this error : lcc preprocessor error: model_main.c:14 Could not find include file "rtmodel.h"
when I look in "model_igc_rtw" directory (where is my generated "model_main.c") i find "rtmodel.h"
lcc is called by : "C:\PROGRA~1\MATLAB\R2009a\sys\lcc\bin\lcc -c -Fomodel_main.obj -DUSE_RTMODEL -DMODEL=model -DRT -DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -DHAVESTDIO -I. -I..\..\.. -IC:\PROGRA~1\MATLAB\R2009a/simulink/include -IC:\PROGRA~1\MATLAB\R2009a/extern/include -IC:\PROGRA~1\MATLAB\R2009a/rtw/c/src -IC:\PROGRA~1\MATLAB\R2009a/rtw/c/libsrc -IC:\PROGRA~1\MATLAB\R2009a/rtw/c/src/ext_mode/common -IC:\PROGRA~1\MATLAB\R2009a/rtw/c/src/ext_mode/tcpip -IC:\PROGRA~1\MATLAB\R2009a/rtw/c/src/ext_mode/serial -IC:\PROGRA~1\MATLAB\R2009a/rtw/c/src/ext_mode/custom -IC:\Simulateurs\sources\NantillaEsouloubre\Simulateur\test\slprj\igc\model -IC:\Simulateurs\sources\NantillaEsouloubre\Simulateur\test -IC:\PROGRA~1\MATLAB\R2009a/toolbox/dspblks/src/sim -IC:\PROGRA~1\MATLAB\R2009a/toolbox/dspblks/src/rt -IC:\PROGRA~1\MATLAB\R2009a/toolbox/commblks/commmex -IC:\PROGRA~1\MATLAB\R2009a\sys\lcc/include -I..\..\..\slprj\igc\_sharedutils -noregistrylookup model_main.c " which seems ok to me
if somebody has an idea about my problem
thanks Fabien
  댓글 수: 1
Kaustubha Govind
Kaustubha Govind 2011년 2월 9일
Could you try using grt.tlc instead and see if you receive the same error? igc.tlc seems like a third-party target.

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

답변 (2개)

Fabien
Fabien 2011년 2월 10일
Hello
if I copy "rtmodel.h" to "C:\PROGRA~1\MATLAB\R2009a/simulink/include" directory the error diseapear but I havs still those errors :
Error model_main.c: 77 syntax error; found `*' expecting `;'
Error model_main.c: 107 syntax error; found `*' expecting `;'
Error model_main.c: 117 undeclared identifier `rtU' ...
where :
77 extern RT_MODEL *MODEL(void);
107 RT_MODEL *S;
  댓글 수: 3
Kaustubha Govind
Kaustubha Govind 2011년 2월 10일
Also, delete the copied rtmodel.h from the simulink/include directory before you try grt.tlc
MarkB
MarkB 2011년 2월 10일
The compiler errors that you are getting indicate that the "rtmodel.h" file that you are using is incorrect/out-of-date. Using line 77 as an example, the compiler sees first sees "extern RT_MODEL". Because the "rtmodel.h" header file is incorrect, it does not contain the typedef for "RT_MODEL". From there, through some quirks and defaults in the specification of the C language, the compiler assumes that this actually means "extern int RT_MODEL(...)", which is the default behaviors of "this function returns an int" and "any parameters are valid". Once the compiler has made those assumptions, the "*" doesn't make sense to it.

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


Fabien
Fabien 2011년 2월 10일
thanks for answers
it is working with grt.tlc target
when I check matlab help, my target (igc_lcc.tmf) seems to implement everything needed for modele reference, but doesn't work
what means "third-party target" ?
  댓글 수: 1
David
David 2011년 2월 10일
A third party product refers to files that you obtained from someone other than MathWorks. In this case the target file igc.tlc is not part of a MathWorks shipped product.

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

카테고리

Help CenterFile Exchange에서 Manual Performance Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by