RTW generates static functions randomly when using Embdedded Matlab Function block

1 回表示 (過去 30 日間)
Laurent Dalbies
Laurent Dalbies 2012 年 4 月 2 日
Hello,
I'm using an Embedded Matlab Function in my SL model. This emf uses subfunctions. In the generated code, a file is created per subfunction but some are declared "extern" (~10) whereas others are declared "static" (2). The static functions make it impossible to compile.
I can't find a reason why those 2 functions are declared static because there's nothing (in my opinion of course...) that makes them different from the others. Could it be a keyword in the function name reserved to declare it static ? the way it is called ? etc...
unfortunatly I can't post the code but any idea is welcome. I'm using Matlab r2009b on Linux.
thx Laurent

回答 (1 件)

TAB
TAB 2012 年 4 月 3 日
I have not much used emf block for code generation, so i have never come across such situation.
But what i can suggest is, you can make emf block at atomic block and configure it's for code generation as inlined or as separate one function.
  1. Right click on emf block & select Subsystem Parameters
  2. Select Treat as Atomic checkbox
  3. Set Real Time Workshop System code, Function name & File name options as required.

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by