Removal of RT_MODEL variables in code generation

I have a question about the usage of reusable function setting in the code interface packaging option for embedded code generation. What i found is that RT_MODEL variable is included in the arguments of the function for the generated code as attached in a file. How can i remove this RT_MODEL variable from the argument?

댓글 수: 1

Asang singh
Asang singh 2019년 8월 26일
Hello byungkeuk,
Currently, I am facing the same problem, I want to know how you removed the rt_model from the step and initialize function.

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

답변 (1개)

Prashant Arora
Prashant Arora 2017년 4월 28일

1 개 추천

Hi byungkeuk,
Code Reusability allows you to receive model data by function arguments. To do so, it creates a real time model object (model_M).
I think you are trying to create a reusable "function" which can just accept inputs and outputs. You can do so by using a "Nonreusable" code interface and just configuring model Functions by using the "Configure Model Functions" button. This allows you to choose a function prototype. You can select "Model Specific C prototypes" and then choose the input and output arguments of the step function. More information can be found at the following link:
Hope this helps!

댓글 수: 1

CMike
CMike 2018년 8월 30일
편집: CMike 2018년 8월 30일
Hi Prashant and byungkeuk,
Is there another way? Because if I do try this it changes the initialize() function too, in way that the external Inputs and Outputs disappear.
from this..
void initialize ()
}
// external inputs
Model_U.In1 = 0.0;
// external outputs
Model_Y.Out1 = 0.0;
}
to this...
void initialize ()
}
// inputs and outputs disappeared
}
Do I have to add this as 'custom code' by myself, or does initialization works after this change completely different?

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

카테고리

도움말 센터 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

질문:

2017년 4월 26일

댓글:

2019년 8월 26일

Community Treasure Hunt

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

Start Hunting!