Simscape run-time parameter in code generation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ramkumar Natarajan
el 22 de Oct. de 2020
Comentada: Ramkumar Natarajan
el 23 de Oct. de 2020
Below is a simple Simscape model of a pendulum. I generated reusable C++ code using Simulink Coder (grt_rtw) and it works fine. But I could not locate or generate a run-time paramter to be available for tuning in the generated code, details below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/389498/image.png)
I have set the State Targets > Specify Position Target > Value as a run-time parameter (see below) and have set the Configuration Parameters > Code Generation > Optimization > Default parameter behavior to be Tunable and configured the run-time parameter variable as ExportedGlobal.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/389503/image.png)
My problem is I still could not locate this run-time parameter variable in the generated code. I want to be able to change the value of this parameter in the generated code without regenerating the code again. How can I get this parameter in the generated code and where will it be in the generated code (which file and data structure)?
Thanks. Any help is appreciated!
0 comentarios
Respuesta aceptada
Juan Sagarduy
el 23 de Oct. de 2020
Hi Ramkumar
It should be visible in the Interface parameter in the generated code. Publish the report and the parameter shall appear. Remember that run-time for structured Simscape parameters is only supported from 2020a.
Best Regards Juan (MathWorks)
Más respuestas (0)
Ver también
Categorías
Más información sobre Run-Time Parameters en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!