S-function based simulink file failed to generate c code

조회 수: 8 (최근 30일)
G K NAVEEN KUMAR
G K NAVEEN KUMAR 2023년 1월 9일
댓글: G K NAVEEN KUMAR 2023년 1월 23일
I am working on one model that works on s function... corresposnding s function code is written and is called from same path of simulink file in matlab... While trying to build using simulink file in order to generate c code.
\\Following error is coming and i want to generate c code from my simulink file Please help
error is
Error: File: C:\Program Files\MATLAB\R2022b\rtw\c\tlc\public_api\utils_api.tlc Line: 473 Column: 10 %exit directive: Simulink Coder Fatal in block: "BridgelessBoostPFCwithAPD/inverter calculate2", block type "S-Function": MFile S-functions without a corresponding TLC file are not supported. You can inline your S-function (fpga_model) by creating a TLC file for it. You can also remap your S-function to C by creating a corresponding C Mex source file and a fpga_model.tlc file in the same directory as the MFile S-function which contains (on the first line):
%% CallAsCMexLevel1
or
%% CallAsCMexLevel2
Please help me to resolve @matlabstaff

답변 (1개)

Mark McBroom
Mark McBroom 2023년 1월 14일
In order to generate C/C++ code from an MFile S-FUnction, you must provide a TLC file. https://www.mathworks.com/help/rtw/tlc/inlining-s-functions.html
  댓글 수: 2
G K NAVEEN KUMAR
G K NAVEEN KUMAR 2023년 1월 23일
The issue is with TLC custom file generation only... Thats why i have posted query to help required to create .tlc generation ....timestwo documentation available in MATLAB website is not aty all sufficient to clear and generate .tlc file for any custom code for S-function where many sub-functions have been called with global variables in .m file.... please provide guidance for your customers ....
G K NAVEEN KUMAR
G K NAVEEN KUMAR 2023년 1월 23일
Please dont send the .tlc file documentation because everyone at MATLAB sends that but its is not sufficient to write custom tlc file unless your code is simple addition or multiplication the documentation wont much help at alll

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

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by