Stateflow with variable solver step time

4 visualizaciones (últimos 30 días)
Jonathan
Jonathan el 15 de Sept. de 2023
Respondida: Jonathan el 28 de Sept. de 2023
Hi,
We would like to use stateflow in our next product. We would like to know if it's possible to generate C code that can be run on a variable time frame ?
We are not 100% sure that the step function will be called at the periodic rate (like fixed step require).
for example, if a delay is put into the chart, the generated code is assuming that the step function is called at a certain rate (invrement only a vraible and compare the delay value). I think we need to have a step function that need to take a delta time or a way of computing the last call time and the new call time and compute de delta.
Hope I'm clear !!
Regards,
Jonathan

Respuestas (2)

Binaya
Binaya el 26 de Sept. de 2023
Hi Jonathan,
I understand that you want to generate C code for your model using the variable-step solver. For Simulink and Embedded coder, the grt.tlcand ert.tlctarget file needs a fixed step solver with discrete time step as the solver configuration. This is done to avoid complex codes and highercomputation power needed for implementing the C code with variable step solver in the hardware.
If you want to use variable step solver for generating the C code, please usersim.tlcas the system target file in code generation configuration parameters. For details please explore the below documentation:
I hope this helps.
Regards
Binaya

Jonathan
Jonathan el 28 de Sept. de 2023
Hi Binaya,
With rsim, should we be able to acheive the main goal ? i.e to be able to call the step function async (not periodycaly) ?
Regards,

Categorías

Más información sobre Complex Logic en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by