code generation with grt.tlc creates private header file

10 vues (au cours des 30 derniers jours)
Chaabane
Chaabane le 22 Oct 2019
Commenté : cui,xingxing le 11 Mar 2022
Hello,
I have generated code for grt.tlc target in c language from Simulink model, version 2018a.
The generated folder modelname_rti_rtw contains a header file named modelname_private.h that declares only one function prototype with extern attribute.
The name of this function is the same of an 'enabled subsystem' in my model. This enabled subsystem has nothing in particular to be declared in a unique way like this ?
It's much easier to have everything in less files as possible to port it later.
Is there a way to configure code generation so it avoids generating this file ?
Thank you,
Chaabane

Réponses (2)

Chaabane
Chaabane le 4 Déc 2019
Any idea guys ?

Sukrut Tamhankar
Sukrut Tamhankar le 8 Mai 2020
The generation of model_private.h can be avoided by setting File Packaging Format to Compact.
This option is available under:
Model Configuration Parameters > Code Generation > Code Placement > Code packaging > File packaging format.
There are 3 settings in file packaging format as : Modular, Compact (with separate data file) and Compact.
Modular setting outputs model_data.c, model_private.h, and model_types.h, in addition to generating model.c and model.h
Compact (with separate data file) setting conditionally outputs model_data.c, in addition to generating model.c and model.h
In Compact setting, the contents of model_data.c are in model.c and the contents of model_private.h and model_types.h are in model.h or model.c
For the contents of these generated files, please refer the table given in the following MATLAB documentation link:
  1 commentaire
cui,xingxing
cui,xingxing le 11 Mar 2022
@Sukrut Tamhankar So the question is, if I don't use simulink , how can I use matlab coder + embeded coder toolbox to generate only a <name>.h and a corresponding <name>.c?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by