Simulink custom target system file configuration (1) - xx.tlc file

foreword

The custom target system file consists of five major files:

  • xx.tlc system target file
  • xx_callback_handler.m RTW toolbox callback function
  • xx_make_rtw_hook.m tlc file call
  • xx_file_process.tlc file processes TLC files
  • xx_srmain.tlc controls the generation of the main function file

System target file xx.tlc

  • This file is mainly used in the generation of the underlying code in the code generation stage to realize one-click generation of the application layer + underlying code .
    After configuring the tlc file, transplant the tlc file to the working path of Matlab , and then click Browse to select the tlc file you wrote.
    configuration picture
%% SYSTLC: Customize the target system configuration TMF: none MAKE: make_rtw EXTMODE: ext_comm
%%用于RTW属性设置窗口的显示内容 TMF,MAKE文件的设置
%selectfile NULL_FILE

%assign CodeFormat = "Embedded-C"

%assign TargetType = "RT"
%assign Language   = "C"

%if !EXISTS("AutoBuildProcedure")
  %if EXISTS("GenerateSampleERTMain")
    %assign AutoBuildProcedure = !GenerateSampleERTMain
  %else
    %% This is for the targets that use jxert.tlc and are required to work
    %% without Embedded Coder. This is to enable auto build procedure since
    %% the GenerateSampleERTMain is always set to true for these targets.
    %assign AutoBuildProcedure = TLC_TRUE
  %endif
%endif

%include "codegenentry.tlc"
%%以上配置代码生成格式、类型、语言等内容

/%
  BEGIN_RTW_OPTIONS
  rtwgensettings.BuildDirSuffix = '_jxert_rtw';
  rtwgensettings.DerivedFrom = 'ert.tlc';
  rtwgensettings.Version = '1';
  rtwgensettings.SelectCallback = ['jxert_callback_handler(hDlg, hSrc)'];
  END_RTW_OPTIONS 
 %/

%%这部分内容是对一些 RTW 生成属性的配置(RTW_OPTIONS)
%%rtwgensettings.BuildDirSuffix = '_jxert_rtw'; 表示生成的文件夹后缀
%%rtwgensettings.DerivedFrom = 'ert.tlc'; 设置继承ert.tlc
%%rtwgensettings.Version = '1'; 必须设置为1 才能启用回调
%%rtwgensettings.SelectCallback = ['jxert_callback_handler(hDlg, hSrc)']; 表示选择 jxert.tlc 目标系统的时候
%%matlab 将自动执行 jxert_callback_handler 函数中的程序

The TLC language is used here , and those who are interested can search for usage.

  • SYSTLC : A descriptor displayed in the browser.
  • TMF : The name of the template makefile (TMF) to use during compilation. This filename will be displayed in the Template makefile field of the Code Generation pane of the Configuration Parameters dialog when the target is selected. Set none when you don't need to generate exe
  • MAKE : The make command to use during compilation. After selecting a target, the command will appear in the Make command field of the Code Generation pane of the Configuration Parameters dialog.
  • EXTMODE : The name of the external mode interface file (if any) associated with the target. Use no_ext_comm if your target does not support external mode.

Guess you like

Origin blog.csdn.net/dbqwcl/article/details/126958665