code generation with grt.tlc creates private header file

10 visualizzazioni (ultimi 30 giorni)
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

Risposte (2)

Chaabane
Chaabane il 4 Dic 2019
Any idea guys ?

Sukrut Tamhankar
Sukrut Tamhankar il 8 Mag 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 Commento
cui,xingxing
cui,xingxing il 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?

Accedi per commentare.

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by