MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Betriebsanweisung Seite 47

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 210
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 46
Introduction
3-3
contents. After Simulink calls mdlInitializeSizes, i t t hen interacts with the
S-function through various other routines (all starting with
mdl). At the end of
a simulation,
mdlTerminate is called.
Unlike M-file S-functions, there is not an explicit
flag parameter associated
with each C MEX S-function routine. This is because Simulink automatically
calls each S-function routine at the appro priate time during its interaction
with theS-function. Also, there are S-function routines associated with C MEX
S-functions that don’t have counterparts in M-file S-functions.
Simulink maintainsinformation abouttheS-functionin a datastructure called
the
SimStruct.The#include file, simstruc.h,thatdefinestheSimStruct
providesmacros thatenableyour MEX-fileto set values inand get values(such
as theinput and output signalt o the block) from the
SimStruct.Thestatement
thatincludesthe definitionof the
SimStruct is shownin “StatementsRequired
at the Top of S-Functi onso n page 3–10. The macros that access the
SimStruct
are described in “The C MEX S-Function SimStruct” on page 3–97. Commonly
used macros that are used to access the
SimStruct are des cribed in the
following sections.
Seitenansicht 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 209 210

Kommentare zu diesen Handbüchern

Keine Kommentare