S-function parameters must be one or two dimensional nonsparse numeric or character arrays unless the S-function uses a TLC file and has an mdlRTW function

15 ビュー (過去 30 日間)
I am trying to build a Simulink function with system terget fule naming "grt.tlc". While performing the same I am getting the follwing error:
Invalid parameters for S-function 'BD_INSIGHT_HIL_19a/SM_Advisor/<vc> insight/pre-TX parallel gearbox control/downshift command/load fraction/S-Function'. For code generation, S-function parameters must be one or two dimensional nonsparse numeric or character arrays unless the S-function uses a TLC file and has an mdlRTW function.
Please help me to relove the issue.
  2 件のコメント
Kuldeep Kumar
Kuldeep Kumar 2022 年 1 月 3 日
Hi,
I am also facing similar error. Have you solved your problem?
一步
一步 2024 年 11 月 9 日
Hi:
I am also facing similar error. Have you solved your problem?can you teach me this question?Thank you!

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

回答 (1 件)

Githin George
Githin George 2024 年 12 月 4 日
As the error message is suggesting, your S-function may be dealing with types other than one or two dimensional nonsparse numeric or character arrays. To support such S-functions for code generation you would need use a custom TLC and specify the “modelRTW” function.
The “mdlRTW” function is generally responsible for providing customization to the generated file “model.rtw” and is invoked before code generation.
You can refer to the following section of the documentation to learn more about writing TLC files for your S-function.
Additionally, the following example might help in providing example code for "mdlRTW" function.
In MATLAB Command Window, type:
>> sfundemos
Click on ‘C-file S Functions’ -> ‘Miscellaneous’ -> ‘Multiple Ports’ to open the demo “ sfcndemo_sfun_multiport”. Inspect the M file mentioned in the example.

カテゴリ

Help Center および File ExchangeCode Generation for Custom Blocks についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by