Technical data
Writing a Block Target File
3-19
Update(block, system)
Include an Update function if the block has code that needs to be updated each 
major time step. Code generated from this function is either placed into 
MdlUpdate or the subsystem’s Update function, depending on whether or not 
the block resides in a nonvirtual subsystem. See 
delay.tlc for an example of 
the 
Update function.
Derivatives(block, system)
Include a Derivatives function when generating code to compute the block’s 
states. Code generated from this function is either placed into 
MdlDerivatives 
or the subsystem’s 
Derivatives function, depending on whether or not the 
block resides in a nonvirtual subsystem. See 
integrat.tlc for an example of 
the 
Derivatives function.
Terminate(block, system)
Include a Terminate function to place any code into MdlTerminate. 
User-defined S-function TLC files can use this function to save data, free 
memory, reset hardware on the target, and so on. See 
tofile.tlc for an 
example of the 
Terminate function.










