MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuale di Servizio Pagina 107

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 282
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 106
Inlining an S-Function
3-33
{
y[0] = u[0] * GAIN;
}
static void
mdlInitializeSampleTimes(SimStruct *S){}
static void
mdlInitializeConditions(real_T *x0,SimStruct *S) {}
static void
mdlUpdate(real_T *x, const real_T *u,SimStruct *S, int_T tid) {}
static void
mdlDerivatives(real_T *dx, const real_T *x const real_T *u,
SimStruct *S, int_T tid) {}
static void
mdlTerminate(SimStruct *S) {}
#ifdef MATLAB_MEX_FILE
#include "simulink.c"
#else
#include "cg_sfun.h"
#endif
Without a TLC file to define the S-function specifics, RTW must call the
MEX-file S-function in a manner similar to RTW 1.3. That is, the execution of
the S-function is through the S-function API.
void
MdlStart()
{
/* S-Function block: foo */
{
SimStruct *s = ssGetSFunction(S, 0);
real_T *sfcnX = ssGetX(s);
sfcnInitializeConditions(sfcnX, s);
}
}
Unnecessary call to
empty function
mdlInitializeCondition
s
in foogain.c.
Vedere la pagina 106
1 2 ... 102 103 104 105 106 107 108 109 110 111 112 ... 281 282

Commenti su questo manuale

Nessun commento