Simulink Coder GRT Target C code integration

I'm working on a Simulink model and i'm generating the code of a Sybsystem using the GRT Target of Simulink Coder (Matlab R2012B). Now i'd like to integrate this code into a custom C/C++ application. My question is: using GRT target what is the minimum number of files (and what are their names) i have to bring into my application project?
Opening some header files i see some specific #includes like:
#include "rtw_continuous.h"
#include "rtw_solver.h"
#include "tmwtypes.h"
But i don't find these files in the folder containing the generated code. Since my Simulink model is using a Discrete Fixed-Step solver, i don't understand the reason of these files.
Thanks,
regards

 Respuesta aceptada

GianCarlo
GianCarlo el 28 de En. de 2014
Editada: GianCarlo el 28 de En. de 2014

2 votos

Hi Massimiliano,
The number and names of the files generated/required when you generate code from your model depends on the blocks and settings used in your model. However, there is an easy way to manage what you're trying to do. You can use the packNGo feature of Simulink Coder to have all of the required generated code files put into a zip file for you to make exporting the code into your project easier. See the documentation here: Relocate Code to Another Development Environment
You can turn on this export in the configuration parameters:
.
The files that are not in your generated code directory are standard header files that you will be able to find in your MATLAB installation folders. They contain support for the different solvers and blocks you might use in your model. The types header file contains type definitions used in the generated code, such as int32_T. Using PackNGo means you won't have to find them for yourself and copy them when you export your code to your project.

6 comentarios

Kurt Stewart
Kurt Stewart el 25 de Mzo. de 2019
I did what you say here but it still does not resolve the issue
Jan
Jan el 2 de Jul. de 2019
[MOVED from flags] Flagged by Gerald Schlegel on 28 Jun 2019 at 12:37.
Same problem on my side ;(
[Please use flags only to inform admins and editors about inappropriate content like spam or rudeness - thanks!]
Ryan Foss
Ryan Foss el 12 de Dic. de 2019
If you had "Generate code only" checked above in the Configuration Parameters, then the includes will not be put into a .zip folder.
However, with just "Package code and artifacts" checked, you will get a .zip file with all the necessary .c and .h files lincluded.
Is your problem get solved or not because I am facing the same problem if solved then how?
Same here. I am missing rtw continuous.h
Its working for me. I have followed the instructions and it generates a zip folder containing the continious and solver header files in a seperate folder.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Coder en Centro de ayuda y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by