S-Function Callback Methods - MATLAB & Simulink (original) (raw)

Main Content

Callback Methods Overview

Every S-function must implement a set of methods, called callback methods, that the Simulink® engine invokes when simulating a model that contains the S-function.

The S-function callback methods perform tasks required at each simulation stage. During simulation of a model, at each simulation stage the Simulink engine calls the appropriate methods for each S-Function block in the model.

Tasks performed by S-function callback methods include:

Some callback methods are optional. The engine invokes an optional callback only if the S-function defines the callback.

Callback Methods for C MEX S-Functions

Required Callback Methods

C MEX S-functions must implement the following callback methods:

Optional Callback Methods

The following callback methods are optional. The engine invokes an optional callback only if the S-function defines the callback.

Callback Methods for Level-2 MATLAB S-Functions

Required Callback Methods

Level-2 MATLAB® S-functions must implement the following callback methods:

For information on writing callback methods, see Write Level-2 MATLAB S-Functions.

Optional Callback Methods

The following callback methods are optional. The engine invokes an optional callback only if the S-function defines the callback.

See Also

Level-2 MATLAB S-Function | S-Function Builder | S-Function | MATLAB Function

Topics