S-Function Builder
Integrate C or C++ code to create S-functions
Libraries:
Simulink /
User-Defined Functions
Description
The S-function Builder block integrates new or existing C or C++ code and creates a C MEX S-function from specifications you provide. See Use a Bus with S-Function Builder to Create an S-Function for detailed instructions on using the S-Function Builder block to generate an S-function.
Instances of the S-Function Builder block also serve as wrappers for
generated S-functions in Simulink® models. When simulating a model that contains instances of an
S-Function Builder block, Simulink software invokes the generated S-function in order to call your C or C++
code in the instance mdlStart
, mdlOutputs
,
mdlDerivatives
, mdlUpdate
and
mdlTerminate
methods. To learn how Simulink engine interacts with S-functions, see Simulink Engine Interaction with C S-Functions.
Note
The S-Function Builder block does not support masking. However, you can mask a Subsystem block that contains an S-Function Builder block. For more information, see Dynamic Masked Subsystem.
Examples
Ports
Input
Output
Parameters
See Build S-Functions Automatically Using S-Function Builder for information about configuring the S-Function Builder block using the S-Function Builder editor.
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
Version History
Introduced before R2006a