From: freccia on
Dear Ralph,
Thank you for your reply.
I have generated the ert_main by using Real Time Workshop. The name of the model is TRIAL whereas the ert_main contains the following code:

#include <stdio.h>
#include "TRIAL.h" /* Model's header file */
#include "rtwtypes.h" /* MathWorks types */

static boolean_T OverrunFlag = 0;

void rt_OneStep(void)
{
/* Check for overrun */
if (OverrunFlag++) {
rtmSetErrorStatus(TRIAL_M, "Overrun");
return;
}
TRIAL_step(0);

/* Get model outputs here */
OverrunFlag--;
}
int_T main(int_T argc, const char_T *argv[])
{
/* Initialize model */
TRIAL_initialize();

while ((rtmGetErrorStatus(TRIAL_M) == NULL) && !rtmGetStopRequested
(TRIAL_M)) {
rt_OneStep();
}
TRIAL_terminate();
return 0;
}
When I compile this main file with the needed header and source files only the Dos windows with a flashing cursor happens and the model is not integrated&#8230; It likely seems that I have to add a simple cycle-for or cycle-while where I should insert the &#8216;TRIAL_step(0)&#8217; or &#8216;TRIAL_step(1)&#8217; or another function which integrates the model along with the integration time.
Is it possible??
Cheers


Ralph Schleicher <rs(a)ralph-schleicher.de> wrote in message <87aay3pti2.fsf(a)echo.mueller-schleicher.i>...
> "freccia " <stendardostefano(a)hotmail.com> writes:
>
> > my question is: what shall I write down in 'while' cycle to integrate
> > my model.
>
> Use the source, Luke!
>
> --
> Ralph Schleicher <http://ralph-schleicher.de>
>
> Development * Consulting * Training
> Mathematical Modeling and Simulation
> Software Tools
 | 
Pages: 1
Prev: plotyy and while loop= :(
Next: rtwgen error