Problem in writing TLC file for Matlab Level2 M file s function

조회 수: 2 (최근 30일)
Am facing issue in creating dll, for that i need to write TLC file for Level2 M file S function. I need TLC file format.... Its is possible to generate code for Level2 M file S function with out tlc file??

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 5월 8일
No, you do need to write a TLC file to generate code from a MATLAB S-function. If your algorithm is simple enough to write as a function (ie. no states or initialize/terminate methods), you may want to try using the MATLAB Function block instead. As long as you're writing MATLAB code that is compatible for code-generation (read the previously linked documentation for details), you will be able to generate code from the block.
  댓글 수: 2
vinothkannan K
vinothkannan K 2013년 5월 9일
Thanks kaustubha for your answer., But am using Level2 s function because its taking data from GUI., It just contains output function only.... For that only i need to writ tlc file... any tlc file format is there? Am trying with different method but its not taking....

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Inibrith
Inibrith 2014년 6월 6일
Hi Kaustubha,
TLC examples in Matlab Documentation are not very useful. I sometimes have the need to hook up some external components into Simulink, using java methods. I would like to have a step by step creation from Level-2 code to TLC to RTW (now Simulink coder) so that my block diagram gets compiled into an executable. The timestwo example basically tells me I have to re-write the code (as if it were really simple) for "optimization". Why such a simple example as multiplying by two needs to be optimized anyway? Like if for multiplying by two, one has first to take the integral of a Riemann series, take the square root, chopping away any complex conjugated number, then take the Lyapunov function (for whatever reason you ever need to do that) to resolve a differential equation... See the picture? Suffice to say, I don't really see any value added by a TLC file, with the example provided.
People looking at such simple (unhelpful BTW) example would raise the (very reasonable) question about: Why can't we automatically generate the TLC file? If it is the same as re-naming functions such as those exposed! Or even better... why not writing it in the first place with that language? If it is "optimized" already, everyone would like to have a faster simulation anytime.
Any useful information, step by step example, where we can hook and tell the compiler how to deal with your M code so that it gets compiled using Simulink coder, would be very much appreciated.
Best regards,
Inibrith H.
  댓글 수: 1
Kaustubha Govind
Kaustubha Govind 2014년 6월 6일
It is currently possible to automatically generate TLC files for C-MEX S-functions using the Legacy Code Tool and S-function Builder.
For MATLAB code, we recommend that you use either the MATLAB Function block or MATLAB System block (MATLAB code needs to be written in the form of a System object) - both blocks automatically generate C code, as long as your MATLAB code is supported for code-generation. Please see the documentation for more information on code-generation support for MATLAB.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Target Language Compiler에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by