| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
Macro | Description |
|---|---|
Get the signal complexity for a bus element. | |
| ssGetBusElementDataType | Get the data type identifier for a bus element. |
Get the dimensions of a bus element. | |
Get the name of a bus element. | |
Get the number of dimensions for a bus element. | |
Get the offset from the start of the bus data type to a bus element. | |
Get the number of elements in a bus signal. | |
Get the value of a block parameter for an S-function block. | |
Determine whether a data type identifier represents a bus signal. | |
Register a data type that a parameter in the Simulink data type table specifies. | |
Specify whether to convert the input bus signal for an S-function from virtual to nonvirtual. | |
Specify whether the output bus signal from an S-function must be virtual or nonvirtual. | |
Specify the name of the bus object that defines the structure and type of the output bus signal. |
Macro | Description |
|---|---|
Get the ID for a data type. | |
| ssGetDataTypeIdAliasedThruTo | Get the ID for the built-in data type associated with a data type alias. |
Get a data type's name. | |
Get a data type's size. | |
Get the zero representation of a data type. | |
Get the data type of an input port. | |
Get the number of data types defined by an S-function or the model. | |
Get the data type of an output port. | |
Get an output signal of any type except double. | |
Register a data type. | |
Specify the size of a data type. | |
Specify the zero representation of a data type. | |
Specify the data type of signals accepted by an input port. | |
| ssSetOutputPortDataType | Specify the data type of an output port. |
Macro | Description |
|---|---|
Get the Simulink data type of a dialog parameter. | |
Get the number of parameters that an S-function expects. | |
Get a parameter entered by a user in the S-Function block dialog box. | |
Get the actual number of parameters specified by the user. | |
Set the number of parameters that an S-function expects. | |
Specify the tunability of a dialog box parameter. |
Macro | Description |
|---|---|
Get a string that identifies the last error. | |
Print a variable-content msg. | |
Report errors. | |
Display a warning message. |
Macro | Description |
|---|---|
Execute a function-call subsystem connected to an S-function. | |
Disable a function-call subsystem connected to this S-function block. | |
Enable a function-call subsystem connected to this S-function. | |
Get the number of function-call destinations. | |
| ssGetExplicitFCSSCtrl | Determine whether this S-function explicitly enables and disables the function-call subsystem that it invokes. |
Specify that an output port element issues a function call. | |
Specify whether an S-function explicitly enables and disables the function-call subsystem that it calls. |
I/O Port — Signal Specification
Macro | Description |
|---|---|
| ssAllowSignalsWithMoreThan2D | Enable S-function to work with multidimensional input and output signals. |
Get the numeric type (complex or real) of an input port. | |
Get the data type of an input port. | |
Determine whether an input port has direct feedthrough. | |
Determine whether a port accepts signal frames. | |
Determine the offset time of an input port. | |
Determine whether the signal elements entering a port must be contiguous. | |
Determine the sample time of an input port. | |
Get the sample time index of an input port. | |
Get the numeric type (complex or real) of an output port. | |
Get the data type of an output port. | |
Determine whether a port outputs signal frames. | |
Determine the offset time of an output port. | |
Determine the sample time of an output port. | |
Set the numeric type (real or complex) of an input port. | |
Set the data type of an input port. | |
Specify that an input port is a direct-feedthrough port. | |
Specify whether a port accepts signal frames. | |
Specify the sample time offset for an input port. | |
Specify that the signal elements entering a port must be contiguous. | |
Set the sample time of an input port. | |
Set the number of input ports on an S-Function block. | |
Specify the number of output ports on an S-Function block. | |
Specify that an input port expects one-based indices. | |
Specify that an output port emits one-based indices. | |
Specify the numeric type (real or complex) of this port. | |
Specify the data type of an output port. | |
Specify whether a port outputs framed data. | |
Specify the sample time offset value of an output port. | |
Specify the sample time of an output port. | |
Specify that an input port expects zero-based indices. | |
Specify that an output port emits zero-based indices. |
I/O Port — Signal Dimensions
Macro | Description |
|---|---|
| ssAddOutputDimsDependencyRule | Register a method to handle current dimensions update. |
| ssAddVariableSizeSignalsRuntimeChecker | Register a method to check the current input dimensions. |
Enable S-function to work with multidimensional signals. | |
| ssGetCurrentInputPortDimensions | Gets the current size of dimension dIdx of input port pIdx. |
| ssGetCurrentInputPortWidth | Gets the total width (total number of elements) of the signal at input port pIdx |
| ssGetCurrentOutputPortDimensions | Gets the current size of dimension dIdx of the signal at output port pIdx. |
| ssGetCurrentOutputPortWidth | Gets the total width (total number of elements) of the signal at output port pIdx. |
Get the dimensions of the signal accepted by an input port. | |
| ssGetInputPortDimensionSize | Get the size of one dimension of the signal entering an input port. |
| ssGetInputPortDimensionsMode | Gets the dimensions mode of the input port indexed by pIdx, |
Get the dimensionality of the signals accepted by an input port. | |
Determine the width of an input port. | |
Get the dimensions of the signal leaving an output port. | |
| ssGetOutputPortDimensionSize | Get the size of one dimension of the signal leaving an output port. |
| ssGetOutputPortDimensionsMode | Sets the dimensions mode of the output port indexed by pIdx. |
Get the number of dimensions of an output port. | |
Determine the width of an output port. | |
| ssSetCurrentOutputPortDimensions | Sets the current size corresponding to dimension dIdx of the output signal at port pIdx. |
| ssSetDWorkRequireResetForSignalSize | Set the block flag for resetting the dIndex Dwork size upon subsystem reset. |
Set the dimensionality of an input port. | |
| ssSetInputPortDimensionsMode | Sets the dimensions mode of the input port indexed by pIdx. |
| ssSetInputPortDimsSameAsOutputPortDims | Set the dimensions of ouput port outIdx to be equal than the dimensions of input port inpIdx. |
Specify dimension information for an input port that accepts matrix signals. | |
Specify dimension information for an input port that accepts vector signals. | |
Set the width of a 1-D (vector) input port. | |
Specify the dimensionality of an output port. | |
Specify dimension information for an output port that emits matrix signals. | |
Specify dimension information for an output port that emits vector signals. | |
Specify the width of a 1-D (vector) output port. | |
Specify the dimensions of a 2-D (matrix) signal. | |
| ssRegMdlSetInputPortDimensionsModeFcn | Register the method to handle dimensions mode propagation for each input port. |
| ssSetSignalSizesComputeType | Set the type of output dependency on the input signal. |
Specify the vector mode that an S-function supports. |
I/O Port — Signal Access
Macro | Description |
|---|---|
Determine the output port that is overwriting an input port's memory buffer. | |
Determine whether an S-Function block port is connected to a nonvirtual block. | |
| ssGetInputPortOptimOpts | Determine the reusability setting of the memory allocated to the input port of an S-function. |
Determine whether an input port can be overwritten. | |
Get the address of a real, contiguous signal entering an input port. | |
Access the signal elements connected to an input port. | |
Get the address of a contiguous signal entering an input port. | |
Get pointers to input signal elements of type other than double. | |
Can be used in any routine (except mdlInitializeSizes) to determine how many input ports a block has. | |
Can be used in any routine (except mdlInitializeSizes) to determine how many output ports a block has. | |
| ssGetOutputPortConnected | Determine whether an output port is connected to a nonvirtual block. |
Determine whether the output of this block is connected to a Merge block. | |
| ssGetOutputPortOptimOpts | Determine the reusability of the memory allocated to the output port of an S-function. |
Access the elements of a signal connected to an output port. | |
Get the vector of signal elements emitted by an output port. | |
| ssSetInputPortOptimOpts | Specify the reusability of the memory allocated to the input port of an S-function. |
Specify whether an input port is overwritable by an output port. | |
| ssSetOutputPortOptimOpts | Specify the reusability of the memory allocated to the output port of an S-function. |
| ssSetOutputPortOverwritesInputPort | Specify whether an output port can share its memory buffer with an input port. |
| Macro | Description |
|---|---|
| ssRTWGenIsModelReferenceRTWTarget | Determine if the model reference Real-Time Workshop target is generating. |
| ssRTWGenIsModelReferenceSIMTarget | Determine if the model reference simulation target is generating. |
| ssSetModelReferenceNormalModeSupport | Specify if S-function can be used in referenced model simulating in normal mode. |
| ssSetModelReferenceSampleTimeDefaultInheritance | Specify that a submodel containing this S-function can inherit its sample time from its parent model. |
| ssSetModelReferenceSampleTimeDisallowInheritance | Specify that the use of this S-function in a submodel prevents the submodel from inheriting its sample time from its parent model. |
Specify whether use of an S-function in a submodel prevents the submodel from inheriting its sample time from the parent model. |
These macros allow you to create, update, and access run-time parameters corresponding to a block's dialog parameters.
Macro | Description |
|---|---|
Get the number of run-time parameters created by this S-function. | |
Get the attributes of a specified run-time parameter. | |
Register all tunable dialog parameters as run-time parameters. | |
Register a run-time parameter. | |
Specify the number of run-time parameters to be created by this S-function. | |
Specify the attributes of a specified run-time parameter. | |
Update all run-time parameters corresponding to tunable dialog parameters. | |
Update a run-time parameter. | |
Update the value of a specified run-time parameter. | |
Update the attributes of a specified run-time parameter from the attributes of the corresponding dialog parameters. |
Macro | Description |
|---|---|
Determine the sample time of an input port. | |
Get the sample time index of an input port. | |
Get the number of sample times an S-function has. | |
| ssGetOffsetTime | Determine one of an S-function's sample time offsets. |
Determine the sample time of an output port. | |
Determine whether a block that uses port-based sample times resides in a triggered subsystem. | |
| ssGetSampleTime | Determine one of an S-function's sample times. |
Get the time of the next sample hit in a discrete S-function with a variable sample time. | |
Determine whether a specified rate is the continuous rate. | |
Determine the sample rate at which an S-function is operating. | |
Determine whether the current sample time hits two specified rates. | |
Determine whether a sample time and offset value pair indicate a triggered sample time. | |
Set the sample time of an input port. | |
| ssSetModelReferenceSampleTimeDefaultInheritance | Specify that a submodel containing this S-function can inherit its sample time from its parent model. |
| ssSetModelReferenceSampleTimeDisallowInheritance | Specify that the use of this S-function in a submodel prevents the submodel from inheriting its sample time from its parent model. |
Specify whether use of an S-function in a submodel prevents the submodel from inheriting its sample time from the parent model. | |
Set the number of sample times an S-function has. | |
Specify the offset of a sample time. | |
Specify a sample time for an S-function. | |
Specify the time of the next sample hit in an S-function. |
Macro | Description |
|---|---|
Get the absolute tolerances used by a model's variable-step solver. | |
Determine whether a block has requested block reduction before the simulation has begun and whether it has actually been reduced after the simulation loop has begun. | |
Get a string that identifies the last error. | |
Determine whether the user has set the inline parameters option for the model containing this S-function. | |
Determine the context in which an S-function is being invoked: normal simulation, external-mode simulation, model editor, etc. | |
| ssGetSimStatus | Determine the current simulation status. |
Get the solver mode being used to solve the S-function. | |
Get the name of the solver being used for the simulation. | |
Get the absolute tolerance used by the model's variable-step solver for a specified state. | |
Get the value of the simulation stop requested flag. | |
Get the current base simulation time. | |
Get the current time for a task. | |
Get the end time of the current simulation. | |
Get the time of the next sample hit. | |
Get the start time of the current simulation. | |
| Determine if the model is running in external mode. | |
Determine whether the current simulation time is equal to the simulation start time. | |
Determine whether the current time step is a major time step. | |
Determine whether the current time step is a minor time step. | |
Determine whether the current solver is a variable-step solver. | |
| Determine if the model is running in Accelerator mode. | |
Request that Simulink attempt to reduce a block. | |
Specify how Simulink treats an S-function when saving and restoring the simulation state of a model containing the S-function. | |
| ssSetSimStateVisibility | Specify whether or not the simulation state of the S-function is visible (accessible) in the simulation state of the model. |
Ask Simulink to reset the solver. | |
Ask Simulink to terminate the simulation at the end of the current time step. |
Macro | Description |
|---|---|
Get an S-function's continuous states. | |
Get an S-function's discrete states. | |
Get a DWork vector. | |
Determine whether the elements of a DWork vector are real or complex numbers. | |
Get the data type of a DWork vector. | |
Get the name of a DWork vector. | |
| ssGetDWorkUsageType | Determine how the DWork vector is used in S-function. |
Determine whether a DWork vector is used as a discrete state vector. | |
Get the size of a DWork vector. | |
Get the derivatives of the continuous states of an S-function. | |
Get an S-function's integer-valued (int_T) work vector. | |
Get a value from a block's integer work vector. | |
Get an S-function's mode work vector. | |
Get an S-function's zero-crossing signals vector. | |
Determine the number of continuous states that an S-function has. | |
Determine the number of discrete states that an S-function has. | |
Get the number of data type work vectors used by a block. | |
Get the size of an S-function's integer work vector. | |
Determine the size of an S-function's mode vector. | |
Determine the number of nonsampled zero crossings that an S-function detects. | |
Determine the size of an S-function's pointer work vector. | |
Determine the size of an S-function's real-valued (real_T) work vector. | |
Get an S-function's pointer (void *) work vector. | |
Get a pointer from a pointer work vector. | |
Get the real (real_T) values of an S-function's discrete state vector. | |
Get an S-function's real-valued (real_T) work vector. | |
Get an element of an S-function's real-valued work vector. | |
Specify whether the elements of a data type work vector are real or complex. | |
Specify the data type of a data type work vector. | |
Specify the name of a data type work vector. | |
| ssSetDWorkUsageType | Specify how the DWork vector is used in S-function. |
Specify that a data type work vector is used as a discrete state vector. | |
Specify the width of a data type work vector. | |
Set an element of a block's integer work vector. | |
Set an element of a block's mode vector. | |
Specify the number of continuous states that an S-function has. | |
Specify the number of discrete states that an S-function has. | |
Specify the number of data type work vectors used by a block. | |
Specify the size of an S-function's integer (int_T) work vector. | |
Specify the number of operating modes that an S-function has. | |
Specify the number of zero crossings that an S-function detects. | |
Specify the size of an S-function's pointer (void *) work vector. | |
Specify the size of an S-function's real (real_T) work vector. | |
Set an element of a block's pointer work vector. | |
Set an element of a block's floating-point work vector. |
Macro | Description |
|---|---|
Get the identifier used to declare a DWork vector in code generated from the associated S-function. | |
| ssGetDWorkRTWIdentifierMustResolveToSignalObject | Get a flag indicating if a DWork vector resolves to a Simulink.Signal object. |
Get the storage class of a DWork vector in code generated from the associated S-function. | |
Get the C type qualifier (e.g., const) used to declare a DWork vector in code generated from the associated S-function. | |
Get the name of the placement group of a block. | |
| Identify any code generation that is not used by the Accelerator. | |
Set the identifier used to declare a DWork vector in code generated from the associated S-function. | |
| ssSetDWorkRTWIdentifierMustResolveToSignalObject | Specify if a DWork vector resolves to a Simulink.Signal object. |
Set the storage class of a DWork vector in code generated from the associated S-function. | |
Set the C type qualifier (e.g., const) used to declare a DWork vector in code generated from the associated S-function. | |
Specify the name of the placement group of a block. | |
Write a Simulink matrix parameter to the S-function's model.rtw file. | |
Write a MATLAB matrix parameter to the S-function's model.rtw file. | |
Write a MATLAB vector parameter to the S-function's model.rtw file. | |
Write tunable parameters to the S-function's model.rtw file. | |
Write settings for the S-function's parameters to the model.rtw file. | |
Write a scalar parameter to the S-function's model.rtw file. | |
Write a string to the S-function's model.rtw file. | |
Write a string parameter to the S-function's model.rtw file. | |
Write a string vector parameter to the S-function's model.rtw file. | |
Write a Simulink vector parameter to the S-function's model.rtw file. | |
Write the S-function's work vectors to the model.rtw file. |
Macro | Description |
|---|---|
Invoke the external mode function for an S-function. | |
Get the name of an S-Function block or model containing the S-function. | |
Get the parent of an S-function. | |
Get the path of an S-function or the model containing the S-function. | |
Return the root (model) SimStruct. | |
Access user data. | |
Specify the external mode function for an S-function. | |
Set various simulation options. | |
Specify the execution order of a sink or source S-function. | |
Specify user data. |
![]() | Introduction | SimStruct Functions — Alphabetical List | ![]() |

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 |