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

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 Kommentare

Hi,
I am also facing similar error. Have you solved your problem?
Hi:
I am also facing similar error. Have you solved your problem?can you teach me this question?Thank you!

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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.

Kategorien

Mehr zu Simulink Coder finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2019a

Gefragt:

am 1 Sep. 2021

Beantwortet:

am 4 Dez. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by