필터 지우기
필터 지우기

Reference Model replaced by S-Function target code generation

조회 수: 1 (최근 30일)
Galen Johney
Galen Johney 2019년 1월 23일
댓글: Mark McBroom 2019년 1월 29일
If I replace a Referenced Model with a generated S-Function, using the interactive process, I get the expected behaviour for simulation purposes.
However, what I need to do is to generate code for an embedded target (NOT PC) that is based on the ert coder. I can generate the code for the stand-alone model using the ert technique, but it seems like I need a separate mex/tlc combination for target code generateion that would integrate the previously built obj/archive file from the S-Function.
What are the recommended approach to build a model that references these types of S-Functions for target code generation?

답변 (1개)

Mark McBroom
Mark McBroom 2019년 1월 28일
Why did you replace the reference model with an S-Function. Best approach is to simply generate code for top model with referenced model. Then you don't need to mess around with S-Functions or TLC.
  댓글 수: 2
Galen Johney
Galen Johney 2019년 1월 29일
Thanks for the reply. Original goals were to both provide some hidden model capability, as well as possibly speed up simulation portions. It looks like the "Protected Model" is more in line with the recommended approach. The "Binary" output solution appears to be dependent on setting up a Toolkit to perform the compilation/linking required to create the binary deployment. With our special target, including external libraries, it seems much easier to just use the Code Generator and do the compile/link external.
Mark McBroom
Mark McBroom 2019년 1월 29일
Yes, Protected Model is the recommended approach to hide model capabilities... however if you allow generating code then you are still exposing model capabilities to users via the resulting C code. Simulation performance with reference models can be sped up by placing the referenced model in Accelerator mode.

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by