How do I pause the executable of a model built using Real-Time Workshop 7.3 (R2009a)?

3 visualizaciones (últimos 30 días)
I have built an executable file using the Real-Time Workshop GRT target. I want to be able to pause the model at a particular simulation time. I am wondering how this can be done.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 30 de Jul. de 2009
To pause the model executable one has to alter the main function in grt_main.c.
In the main function, there is a 'while' loop which calls rt_OneStep at every step of the model execution. To pause the executable at a particular time, query the current sample time and insert a conditional sleep/pause before the call to rt_OneStep.
For example, insert the following code fragment in grt_main.c before the call to rt_OneStep in the main function:
curr_time = rtmGetT(S);
if (curr_time == 5)
sleep(1000);
end
rt_OneStep(S)

Más respuestas (0)

Etiquetas

Productos


Versión

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by