How can I generate a C function from a subsystem?
이전 댓글 표시
Hi everyone!
I want to create a C function from a subsystem. The goal is to create a nice GUI application in C/C++ for control applications, while using Simulink to create the PID regulators.
But let's just say that the subsystem contains a discrete integrator, and its sample time is set to 0.1s. How can I generate, or rather call the function that Simulink Coder generates?
Let the blocks name be MyIntegrator.
I checked Treated as atomic and packaging as Reusable function.
I want to generate a function, something like:
double MyIntegrator(double input)
and when called, it would return the current output of the integrator block.
Of course I would be responsible for calling it with the period.
How can I achieve this functionality using Simulink Coder?
Do I need to call the ..._step() fuction periodically, while updating the ..._U - input block? And then read the ..._Y block for the output?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Schedule Model Components에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!