필터 지우기
필터 지우기

Reusable functions (embedded coder) and model reference

조회 수: 2 (최근 30일)
Paolo
Paolo 2014년 1월 17일
댓글: Vivek 2024년 5월 15일
I have a model A which contains two other models B and C through the model referencing. All this models use a block defined in a custom library. I have set "Function packaging: Reusable function" for the library block. By this way each model (A, B or C) reuse code for the block. However in the generated C code, for each model I have a different function (with different signature but the same implementation). I would create reusable code for the library block. That is I want only one implementation for the function called by all the models A, B and C. I tried to set function name and File name for the library block but I get an error
"Potential conflicting usages of identifier 'rtZCSV_GainLib': a global identifier from model B, and a global identifier from model C The conflict may be resolved by increasing the maximum identifier length on the Symbols pane of the Configuration Parameters dialog box. Otherwise the conflicting identifiers need to be renamed."
Is it possible generate only one implementation for the library block in a given c files and configure all the models A, B, C in a way that they call the same function? What are the settings I have to use?
Thanks,
Paolo

답변 (2개)

Yihe Zuo
Yihe Zuo 2014년 10월 25일
I also got the problem, still can't figure out what is wrong. The best solution is to configure function package to be 'Auto'.
  댓글 수: 1
Vivek
Vivek 2024년 5월 15일
Did you get the solution for this error? If yes please mention, it would be helpful.

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


Raghav Paul
Raghav Paul 2019년 10월 2일
Check out this feature:
This generates one copy of the subsystem code in slprj/ert/_sharedutils that will be reused across the model reference hierarchy. You can debug why code isn't reused using the method described here:

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by