Effacer les filtres
Effacer les filtres

How do I run the C code generated fomr a simulink model that contains S function

3 vues (au cours des 30 derniers jours)
Jack
Jack le 11 Mai 2015
I am working on C code generation from Simulink model. Some subsystems of the model were built using S function. After I generate code from the modle with "non-inlined S function" checked, I passed the "model check" and successfully generated the C code (matlab2014a 32bit). However, when I collect all the .c and .h file and try to run in Dev C++. I always got the error message :
"error Unrecognized use.",
"error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE" ,
"[Error] unknown type name 'mxArray'"and "[Error] unknown type name 'RTWSfcnInfo'".
It seems the simstruc.h must be included as required from the generated C code, but it is conflicting with some files. Is there any solution to this problem, such that I can run the generated C code. I tried the case without S function , everything was as expected

Réponses (1)

Sainath Varikuti
Sainath Varikuti le 13 Mai 2015
It is possible that dependent header files are missing during compilation. Use pack and go functionality to package all the necessary files and dependents by using the following command before compiling it in external IDE.
set_param(your_model, 'PostCodeGenCommand','packNGo(buildInfo, {''packType'' ''hierarchical''})');

Community Treasure Hunt

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

Start Hunting!

Translated by