MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual de Serviço Página 112

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 282
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 281 282

Comentários a estes Manuais

Sem comentários