MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Uživatelská příručka Strana 163

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 210
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 162
Converting Level 1 C MEX S-Functions to Level 2
3-119
If your S -function has a nonempty mdlInitializeConditions, then update
it to the following form
#define MDL_INITIALIZE_CONDITIONS
static void mdlInitializeConditions(SimStruct *S)
{
}
otherwise, delete the function.
- The continuous states are accessed using
ssGetContStates.ThessGetX
macro has been removed.
- The discrete states are accessed using
ssGetRealDiscStates(S).The
ssGetX macro has been removed.
- For mixed continuous and discrete state S-functions, the state vector no
longer consists of thecontinuousstatesfollowedby thediscretestates.The
states are saved in separate vectors and hence may not be contiguous in
memory.
The
mdlOutputs prototype has changed from
static void mdlOutputs( real_T *y, const real_T *x,
const real_T *u, SimStruct *S, int_T tid)
to:
static void mdlOutputs(SimStruct *S, int_T tid)
Since y, x,anduare not explicitly passed into Level-2 S-functions, you must
use:
-
ssGetInputPortRealSignalPtrs to access inputs.
-
ssGetOutputPortSignal to access the outputs.
-
ssGetContStates or ssGetRealDiscStates to access the states.
The
mdlUpdate function prototype has been changed from
void mdlUpdate(real_T *x, real_T *u, Simstruct *S, int_T tid)
to:
void mdlUpdate(SimStruct *S, int_T tid)
Zobrazit stránku 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 209 210

Komentáře k této Příručce

Žádné komentáře