Generate static library (.lib) to redistribute S-Function for code generation

조회 수: 5 (최근 30일)
Sebastian
Sebastian 2020년 10월 27일
댓글: majety 2020년 11월 4일
Hi everybody,
I get from a 3rd Party an S-Function which I integrate in my Simulink model, from which I need to generate code. Because of intellectual property issues, they understandably don't deliver any source Code.
This 3rd party supplies the .mex64 for cosimulation, dummy .c and .h files with no content, and a static library (.lib) file.
In the Code Generation options, under "Custom Code/Libraries" I can set the name of the provided .lib file, and with that I'm able to generate code from my Model which includes the S-Function.
So I know that this .lib file alone should contain in any way the encripted source code. Up to here, alright.
My problem appears now when I reverse the problem: I have to provide the s-Function for code generation in another Simulink model.
How do I generate that static library from a function of my self that I need to redistribute whitout the source code ??
I've generated the s-function by using the rtwsfcn.tlc file. It does create a .lib file, but I'm still not able to compile a test Simulink model which uses the s-Function. Simulink coder asks instead for the buildInfo.mat file.
Where is the trick ? How do I need to generate the S-Function ?
I will appreciate any help ;-)
  댓글 수: 1
majety
majety 2020년 11월 4일
Can you provide more information on the buildInfo.mat error? You can try using S-Function builder to import your generated S-Function into the test model. Additionally try using the Legacy code tool, to generate the S-Function instead of rtwsfcn.tlc file. This will generate all the necessary files that your S-Function would need to import later. Let me know if that works!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by