Motorola DSP Developer's Kit    

S-Function Blocks

Perform these three steps to link your S-function MEX-file to a Simulink block:

  1. Choose the S-Function User Definable block from the Simulink Library Browser.
  2. Double-click on the S-Function block to open the dialog box.

    The parameter names that you specify here are the variable names that are mapped to the dialog box prompts in the next step. These parameters are treated by Simulink as MATLAB mxArrays.

    An example of accessing these parameters from your S-function MEX-file is provided in the template.

    The above three string parameters (most likely to be used in the Motorola S-function MEX-files) can be accessed by using the following support functions.

    Alternatively, the integer parameters may be accessed by using mx functions.

  1. Select Edit->Mask S-Function. This will open the Mask Editor. Masking your S-Function block is a useful way to provide dynamic parameters to your S-function MEX-file code via dialog box prompts. For more detailed information read Chapter 6, "Using Masks to Customize Blocks", of Using Simulink.

Instantiating the Simulink DSP Simulator

See Instantiating the Motorola DSP Simulator for more information on how to instantiate the DSP simulator.

Running Your Simulation

See Running the Simulation for more information on how to start execution of the simulator program.

Importing Data to DSP Simulator

See Importing Data to DSP Simulator for more information on writing data to the DSP simulator.

Exporting Data to Simulink

See Exporting Data to MATLAB for more information on how to read data out of the DSP simulator.

Terminating and Allocating Memory Cleanup

See Terminating and Allocated Memory Cleanup for more information on how to end the simulation and how to free memory allocated during the execution of the MEX-file.


 Output Objects Tutorial of Advanced Features