Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Frame-Based Signals

About Frame-Based Signals

This section explains how to create an S-function that accepts and/or produces frame-based signals. See Frame-Based Signals in the Working with Signals section of the Signal Processing Blockset documentation for a comprehensive discussion of the use of frame-based signals in Simulink models.

Using Frame-Based Signals in C S-Functions

To accept or produce frame-based signals, a C MEX S-function must perform the following tasks:

See the frame-based A/D converter S-function example (sfun_frmad.c) for an example of how to create a frame-based S-function. This S-function is one of several S-functions that manipulate frame-based signals found in the Simulink model sfcndemo_frame.mdl.

Using Frame-Based Signals in Level-2 M-File S-Functions

In a Level-2 M-file S-function, set the SamplingMode property of the port to indicate if the block accepts frame-based signals, for example:

block.InputPort(1).SamplingMode = 'Inherited';

If any of the ports inherited their sampling mode, define a SetInputPortSamplingMode callback method to specify the sampling mode.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS