Technical data
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