code generation with grt.tlc creates private header file

조회 수: 11 (최근 30일)
Chaabane
Chaabane 2019년 10월 22일
댓글: cui,xingxing 2022년 3월 11일
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

답변 (2개)

Chaabane
Chaabane 2019년 12월 4일
Any idea guys ?

Sukrut Tamhankar
Sukrut Tamhankar 2020년 5월 8일
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
cui,xingxing
cui,xingxing 2022년 3월 11일
@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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by