1 library block is generated in autocode as 2 different functions. How can I generate 1 common function?

조회 수: 4 (최근 30일)
I have created a custom library 'abc' in Simulink and set it as atomic. This atomic library is used at 2 places in the model and where its used as follow: 1. it gets input signal which is generated locally in the same subsystem. 2. it gets input signal which is generated in another atomic subsystem.
So when I generate code using Embedded Coder, two different functions are generated. 1. abc() -> this uses the local signal 2. abc_x() -> this uses the signal from another atomic subsystem
My problem is 2 different functions are used which increase in memory consumption. So how can I generate 1 common function for both the purpose ?

답변 (1개)

TAB
TAB 2018년 8월 30일
In Subsystem block parameter dialog, goto "Code Generation" tab and select "Function Packaging" as "Reusable function".
  댓글 수: 1
GK
GK 2018년 8월 30일
Thanks for your effort. It is already set as 'reusable function'. And custom function name as name of the library block - 'abc'.

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

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by