MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuel de service Page 112

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 282
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 111
3
Writing Target Language Files
3-38
By including this simple target file for this S-function block, the code is
generated as:
void
MdlStart(){}
void
MdlOutputs(tid)
{
/* S-Function block: foo */
rtB.foo = rtGROUND * rtP.foo.gain;
}
void
MdlUpdate(tid){}
void
MdlTerminate(){}
/* function to register model in SimStruct */
Simstruct *foogain()
{
:
: /* Model Registration
(does NOT need to register S-function) */
:
}
So, including a TLC file drastically decreased the code size and increased the
execution efficiency of the generated code. These notes highlight some
information about the TLC code and the generated output:
Note 1
The TLC directive %implements is required by all block target files, and
must be the first executable statement in the block target file. This
directive guarantees that the Target Language Compiler does not
execute an inappropriate target file for S-function
foogain.
Note 2
Note 3
Vue de la page 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 281 282

Commentaires sur ces manuels

Pas de commentaire