Table 3-6: Model Callback Parameters
Parameter
|
When Executed
|
CloseFcn
|
Before the block diagram is closed.
|
PostLoadFcn
|
After the model is loaded. Defining a callback routine for this parameter might be useful for generating an interface that requires that the model has already been loaded.
|
InitFcn
|
Called at start of model simulation.
|
PostSaveFcn
|
After the model is saved.
|
PreLoadFcn
|
Before the model is loaded. Defining a callback routine for this parameter might be useful for loading variables used by the model.
|
PreSaveFcn
|
Before the model is saved.
|
StartFcn
|
Before the simulation starts.
|
StopFcn
|
After the simulation stops. Output is written to workspace variables and files before the StopFcn is executed.
|
Table 3-7: Block Callback Parameters
Parameter
|
When Executed
|
CloseFcn
|
When the block is closed using the close_system command.
|
CopyFcn
|
After a block is copied. The callback is recursive for Subsystem blocks (that is, if you copy a Subsystem block that contains a block for which the CopyFcn parameter is defined, the routine is also executed). The routine is also executed if an add_block command is used to copy the block.
|
DeleteFcn
|
Before a block is deleted. This callback is recursive for Subsystem blocks.
|
DestroyFcn
|
When block has been destroyed.
|
InitFcn
|
Before the block diagram is compiled and before block parameters are evaluated.
|
LoadFcn
|
After the block diagram is loaded. This callback is recursive for Subsystem blocks.
|
ModelCloseFcn
|
Before the block diagram is closed. This callback is recursive for Subsystem blocks.
|
MoveFcn
|
When block is moved or resized.
|
NameChangeFcn
|
After a block's name and/or path changes. When a Subsystem block's path is changed, it recursively calls this function for all blocks it contains after calling its own NameChangeFcn routine.
|
OpenFcn
|
When the block is opened. This parameter is generally used with Subsystem blocks. The routine is executed when you double-click on the block or when an open_system command is called with the block as an argument. The OpenFcn parameter overrides the normal behavior associated with opening a block, which is to display the block's dialog box or to open the subsystem.
|
ParentCloseFcn
|
Before closing a subsystem containing the block or when the block is made part of a new subsystem using the new_system command (see new_system).
|
PreSaveFcn
|
Before the block diagram is saved. This callback is recursive for Subsystem blocks.
|
PostSaveFcn
|
After the block diagram is saved. This callback is recursive for Subsystem blocks.
|
StartFcn
|
After the block diagram is compiled and before the simulation starts.
|
StopFcn
|
At any termination of the simulation.
|
UndoDeleteFcn
|
When a block delete is undone.
|