How to generate a tlc. file for S-function matlab script?

13 ビュー (過去 30 日間)
Endrias
Endrias 2019 年 1 月 16 日
コメント済み: liangjunfu 2023 年 5 月 26 日
Hallo,
I tried to run a contoller whch is written in S-function m. code. And then i got the following error.
Error: File: C:\Program Files\MATLAB\R2017b\rtw\c\tlc\lib\utillib.tlc Line: 1410 Column: 8 %exit directive: Simulink Coder Fatal in block: "ENCODER/S-Function2", block type "S-Function": MFile S-functions without a corresponding TLC file are not supported. You can inline your S-function (ctrl_SMCForce) 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 ctrl_SMCForce.tlc file in the same directory as the MFile S-function which contains (on the first line): %% CallAsCMexLevel1 or %% CallAsCMexLevel2
I don't have any idea how to create TCL file. Matworks give an example called (twotimes) which i could not understand the concept. Can someone help me how to create this file?? Is it possible to generate is automatically or do i have to code it from scratch??
Thx!
  1 件のコメント
Anda
Anda 2022 年 8 月 11 日
Try legacy_code('sfcn_tlc_generate', specs)

サインインしてコメントする。

回答 (2 件)

tianhao chen
tianhao chen 2019 年 10 月 26 日
I met the same problem. Do you know how to generate tlc now?
  1 件のコメント
Anda
Anda 2022 年 8 月 11 日
Try legacy_code('sfcn_tlc_generate', specs)

サインインしてコメントする。


Zohaib Latif
Zohaib Latif 2022 年 7 月 19 日
I have the same issue. Any one got solution?
  2 件のコメント
Anda
Anda 2022 年 8 月 11 日
Try legacy_code('sfcn_tlc_generate', specs)
liangjunfu
liangjunfu 2023 年 5 月 26 日
Is this line of code not converting a level2 s-function .m file to a tlc file

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by