What do you mean by "Inlining s-function"?

1 回表示 (過去 30 日間)
swaraj
swaraj 2012 年 6 月 11 日
コメント済み: Marian Kersting 2018 年 1 月 17 日
What do you mean by "Inlining s-function"?

採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 6 月 11 日
Typically C S-functions are separate MEX-files (DLLs) - if you do not inline them (by providing a TLC-file for it), then the generated code will call into this DLL whenever the block methods need to be executed. The S-function methods require various arguments, one of which is the SimStruct pointer 'S' - this is a fairly large data structure that needs to be passed around. Therefore calling into the S-function DLL from the generate code can produce a large overhead. Instead, providing a TLC-file will result in the methods corresponding to the S-function being inlined (or added) into the model.c file directly. There is no need to make additional calls into external DLLs. Also, there is no need for the SimStruct pointer to be maintained. Therefore, models with all inlined S-functions generate much more efficient code.
  2 件のコメント
Birdman
Birdman 2017 年 10 月 9 日
How the tlc file for inlining the s-function will be provided?
Marian Kersting
Marian Kersting 2018 年 1 月 17 日
See here: https://de.mathworks.com/help/simulink/sfg/how-to-implement-s-functions.html
as far as I unterstood you have to write it on your own. Though MathWorks help you with giving several Examples (Do not alter them, instead make a copy) Somewhere they have this "TimesTwo" Example...

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

その他の回答 (0 件)

カテゴリ

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