TLC and MEXW64 files for Code Generation

조회 수: 17 (최근 30일)
Narudol Tatiyavattanachai
Narudol Tatiyavattanachai 2022년 1월 12일
댓글: Saba Hajhassan 2023년 7월 19일
Dear Sir,
I am new to code generation process.
Could you guy help out the understanding of this linkage among code generation process for target hardware?
I look into many S-Function and Legacy tool for C-code integration for target embbeded hardware and code generation.
Still, very confusing. (Specifically, TEXAS INSTRUMENT C2000 series)
Actually, I want to include some customed EXT_EEPROM.C and EXT_EEPROM.h file to get external hardware work with Code Generation process.
The function inside are like eepInitilize(); eepRead(); eepWrite; etc.
I found that there are only 2 important files to make these happen in Simulink Enviroment.
1) TLC file (Assuming for linkage function to hardware driver resouces ex. SPI, I2C, GPIO driver, etc.)
2) MEXW64 file (Assumming for a compiled version of EXT_EEPROM.c & EXT_EEPROM.h for S-Function)
Does my above understanding were correct ?
And how many TLC/MEXW64 should i create ?
And Which process/toolbox should I use in MATLAB to create above files ?
Could you give a hinch or and guildline for this integration?
Best Regards,
Narudol T.

채택된 답변

Mark McBroom
Mark McBroom 2022년 1월 31일
Use the following legacy_code option to generate TLC code for an s-function.
legacy_code('sfcn_tlc_generate', specs)

추가 답변 (1개)

Mark McBroom
Mark McBroom 2022년 1월 29일
Your understanding is correct for TLC files and mexw64 files.
Assuming you already have Simulink and Simulink Coder licenses, no additional licenses are needed. There are two ways to create the S-Function. In my experience, the legacycode tool works better for hardware blocks like this because it allows you to have different behavoir for simulation and code generation.
  댓글 수: 2
Narudol Tatiyavattanachai
Narudol Tatiyavattanachai 2022년 1월 30일
Hi Mark,
Thank you very much for your clarification.
Yes, I think I use the Legacy Code Tool ("LCT") to generate MEXW64 files.
However, I not know how to generate the TLC files.
Can you help recommend ?
Thank you in advanced.
Best Regards,
Narudol T.
Saba Hajhassan
Saba Hajhassan 2023년 7월 19일
could you please help me how to create a TLC file and .c file of the .m S-function?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by