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
11 views (last 30 days)
Show older comments
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 Comments
一步
on 9 Nov 2024
Hi:
I am also facing similar error. Have you solved your problem?can you teach me this question?Thank you!
Answers (1)
Githin George
on 4 Dec 2024
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.
0 Comments
See Also
Categories
Find more on Code Generation for Custom Blocks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!