using "modele reference" with RTW

2 visualizaciones (últimos 30 días)
Fabien
Fabien el 9 de Feb. de 2011
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 comentario
Kaustubha Govind
Kaustubha Govind el 9 de Feb. de 2011
Could you try using grt.tlc instead and see if you receive the same error? igc.tlc seems like a third-party target.

Iniciar sesión para comentar.

Respuestas (2)

Fabien
Fabien el 10 de Feb. de 2011
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 comentarios
Kaustubha Govind
Kaustubha Govind el 10 de Feb. de 2011
Also, delete the copied rtmodel.h from the simulink/include directory before you try grt.tlc
MarkB
MarkB el 10 de Feb. de 2011
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.

Iniciar sesión para comentar.


Fabien
Fabien el 10 de Feb. de 2011
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 comentario
David
David el 10 de Feb. de 2011
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Manual Performance Optimization en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by