Simulink code generation utility function

조회 수: 6 (최근 30일)
Raymond Gilbert
Raymond Gilbert 2019년 3월 4일
답변: Mark McBroom 2019년 3월 6일
So, I am generating some C code for a model I have created using some code that I have modified.
The original 'autocoding' scripts produced a .h and .c file called look2_binlxpw
The scipt I have created shoves that look2 inside of the main .h and .c file.
That would normally be okay but the end goal is to provide this code to a customer and when I do so, I would rather have one utility that I can pass forward, since multiple files will end up coding with this look2_bin.
The old code that separated this away from the main function did so using
set_param(subsystem, 'RTWOptions', opts);
Where opts was a huge array of data, but it was set up in there. I am trying to avoid RTWOptions as it is obsolete
rtwtypes, rtgetNaN, rtnonfinite are all created and placed in the project folder. Not sure why this one wont or what the proper parameter for it is.

채택된 답변

Mark McBroom
Mark McBroom 2019년 3월 6일
If you change the configuration parameter UtilityFunctionGeneration to "Shared location",
set_param(bdroot,'UtilityFuncGeneration', 'Shared location')
then code for blocks such as lookup table blocks will be placed in:
/slprj/ert/_sharedutils

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by