Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

SimStruct Macros and Functions Listed by Usage

Buses

Macro

Description

ssGetBusElementComplexSignal

Get the signal complexity for a bus element.

ssGetBusElementDataType

Get the data type identifier for a bus element.

ssGetBusElementDimensions

Get the dimensions of a bus element.

ssGetBusElementName

Get the name of a bus element.

ssGetBusElementNumDimensions

Get the number of dimensions for a bus element.

ssGetBusElementOffset

Get the offset from the start of the bus data type to a bus element.

ssGetNumBusElements

Get the number of elements in a bus signal.

ssGetSFcnParamName

Get the value of a block parameter for an S-function block.

sslsDataTypeABus

Determine whether a data type identifier represents a bus signal.

ssRegisterTypeFromParameter

Register a data type that a parameter in the Simulink data type table specifies.

ssSetBusInputAsStruct

Specify whether to convert the input bus signal for an S-function from virtual to nonvirtual.

ssSetBusOutputAsStruct

Specify whether the output bus signal from an S-function must be virtual or nonvirtual.

ssSetBusOutputObjectName

Specify the name of the bus object that defines the structure and type of the output bus signal.

Data Type

Macro

Description

ssGetDataTypeId

Get the ID for a data type.

ssGetDataTypeIdAliasedThruToGet the ID for the built-in data type associated with a data type alias.

ssGetDataTypeName

Get a data type's name.

ssGetDataTypeSize

Get a data type's size.

ssGetDataTypeZero

Get the zero representation of a data type.

ssGetInputPortDataType

Get the data type of an input port.

ssGetNumDataTypes

Get the number of data types defined by an S-function or the model.

ssGetOutputPortDataType

Get the data type of an output port.

ssGetOutputPortSignal

Get an output signal of any type except double.

ssRegisterDataType

Register a data type.

ssSetDataTypeSize

Specify the size of a data type.

ssSetDataTypeZero

Specify the zero representation of a data type.

ssSetInputPortDataType

Specify the data type of signals accepted by an input port.

ssSetOutputPortDataTypeSpecify the data type of an output port.

Dialog Box Parameters

Macro

Description

ssGetDTypeIdFromMxArray

Get the Simulink data type of a dialog parameter.

ssGetNumSFcnParams

Get the number of parameters that an S-function expects.

ssGetSFcnParam

Get a parameter entered by a user in the S-Function block dialog box.

ssGetSFcnParamsCount

Get the actual number of parameters specified by the user.

ssSetNumSFcnParams

Set the number of parameters that an S-function expects.

ssSetSFcnParamTunable

Specify the tunability of a dialog box parameter.

Error Handling and Status

Macro

Description

ssGetErrorStatus

Get a string that identifies the last error.

ssPrintf

Print a variable-content msg.

ssSetErrorStatus

Report errors.

ssWarning

Display a warning message.

Function Call

Macro

Description

ssCallSystemWithTid

Execute a function-call subsystem connected to an S-function.

ssDisableSystemWithTid

Disable a function-call subsystem connected to this S-function block.

ssEnableSystemWithTid

Enable a function-call subsystem connected to this S-function.

ssGetCallSystemNumFcnCallDestinations

Get the number of function-call destinations.

ssGetExplicitFCSSCtrlDetermine whether this S-function explicitly enables and disables the function-call subsystem that it invokes.

ssSetCallSystemOutput

Specify that an output port element issues a function call.

ssSetExplicitFCSSCtrl

Specify whether an S-function explicitly enables and disables the function-call subsystem that it calls.

Input and Output Ports

I/O Port — Signal Specification

Macro

Description

ssAllowSignalsWithMoreThan2DEnable S-function to work with multidimensional input and output signals.

ssGetInputPortComplexSignal

Get the numeric type (complex or real) of an input port.

ssGetInputPortDataType

Get the data type of an input port.

ssGetInputPortDirectFeedThrough

Determine whether an input port has direct feedthrough.

ssGetInputPortFrameData

Determine whether a port accepts signal frames.

ssGetInputPortOffsetTime

Determine the offset time of an input port.

ssGetInputPortRequiredContiguous

Determine whether the signal elements entering a port must be contiguous.

ssGetInputPortSampleTime

Determine the sample time of an input port.

ssGetInputPortSampleTimeIndex

Get the sample time index of an input port.

ssGetOutputPortComplexSignal

Get the numeric type (complex or real) of an output port.

ssGetOutputPortDataType

Get the data type of an output port.

ssGetOutputPortFrameData

Determine whether a port outputs signal frames.

ssGetOutputPortOffsetTime

Determine the offset time of an output port.

ssGetOutputPortSampleTime

Determine the sample time of an output port.

ssSetInputPortComplexSignal

Set the numeric type (real or complex) of an input port.

ssSetInputPortDataType

Set the data type of an input port.

ssSetInputPortDirectFeedThrough

Specify that an input port is a direct-feedthrough port.

ssSetInputPortFrameData

Specify whether a port accepts signal frames.

ssSetInputPortOffsetTime

Specify the sample time offset for an input port.

ssSetInputPortRequiredContiguous

Specify that the signal elements entering a port must be contiguous.

ssSetInputPortSampleTime

Set the sample time of an input port.

ssSetNumInputPorts

Set the number of input ports on an S-Function block.

ssSetNumOutputPorts

Specify the number of output ports on an S-Function block.

ssSetOneBasedIndexInputPort

Specify that an input port expects one-based indices.

ssSetOneBasedIndexOutputPort

Specify that an output port emits one-based indices.

ssSetOutputPortComplexSignal

Specify the numeric type (real or complex) of this port.

ssSetOutputPortDataType

Specify the data type of an output port.

ssSetOutputPortFrameData

Specify whether a port outputs framed data.

ssSetOutputPortOffsetTime

Specify the sample time offset value of an output port.

ssSetOutputPortSampleTime

Specify the sample time of an output port.

ssSetZeroBasedIndexInputPort

Specify that an input port expects zero-based indices.

ssSetZeroBasedIndexOutputPort

Specify that an output port emits zero-based indices.

I/O Port — Signal Dimensions

Macro

Description

ssAddOutputDimsDependencyRuleRegister a method to handle current dimensions update.
ssAddVariableSizeSignalsRuntimeCheckerRegister a method to check the current input dimensions.

ssAllowSignalsWithMoreThan2D

Enable S-function to work with multidimensional signals.

ssGetCurrentInputPortDimensionsGets the current size of dimension dIdx of input port pIdx.
ssGetCurrentInputPortWidthGets the total width (total number of elements) of the signal at input port pIdx
ssGetCurrentOutputPortDimensionsGets the current size of dimension dIdx of the signal at output port pIdx.
ssGetCurrentOutputPortWidthGets the total width (total number of elements) of the signal at output port pIdx.

ssGetInputPortDimensions

Get the dimensions of the signal accepted by an input port.

ssGetInputPortDimensionSizeGet the size of one dimension of the signal entering an input port.
ssGetInputPortDimensionsModeGets the dimensions mode of the input port indexed by pIdx,

ssGetInputPortNumDimensions

Get the dimensionality of the signals accepted by an input port.

ssGetInputPortWidth

Determine the width of an input port.

ssGetOutputPortDimensions

Get the dimensions of the signal leaving an output port.

ssGetOutputPortDimensionSizeGet the size of one dimension of the signal leaving an output port.
ssGetOutputPortDimensionsModeSets the dimensions mode of the output port indexed by pIdx.

ssGetOutputPortNumDimensions

Get the number of dimensions of an output port.

ssGetOutputPortWidth

Determine the width of an output port.

ssSetCurrentOutputPortDimensionsSets the current size corresponding to dimension dIdx of the output signal at port pIdx.
ssSetDWorkRequireResetForSignalSizeSet the block flag for resetting the dIndex Dwork size upon subsystem reset.

ssSetInputPortDimensionInfo

Set the dimensionality of an input port.

ssSetInputPortDimensionsModeSets the dimensions mode of the input port indexed by pIdx.
ssSetInputPortDimsSameAsOutputPortDimsSet the dimensions of ouput port outIdx to be equal than the dimensions of input port inpIdx.

ssSetInputPortMatrixDimensions

Specify dimension information for an input port that accepts matrix signals.

ssSetInputPortVectorDimension

Specify dimension information for an input port that accepts vector signals.

ssSetInputPortWidth

Set the width of a 1-D (vector) input port.

ssSetOutputPortDimensionInfo

Specify the dimensionality of an output port.

ssSetOutputPortMatrixDimensions

Specify dimension information for an output port that emits matrix signals.

ssSetOutputPortVectorDimension

Specify dimension information for an output port that emits vector signals.

ssSetOutputPortWidth

Specify the width of a 1-D (vector) output port.

ssSetOutputPortMatrixDimensions

Specify the dimensions of a 2-D (matrix) signal.

ssRegMdlSetInputPortDimensionsModeFcnRegister the method to handle dimensions mode propagation for each input port.
ssSetSignalSizesComputeTypeSet the type of output dependency on the input signal.

ssSetVectorMode

Specify the vector mode that an S-function supports.

I/O Port — Signal Access

Macro

Description

ssGetInputPortBufferDstPort

Determine the output port that is overwriting an input port's memory buffer.

ssGetInputPortConnected

Determine whether an S-Function block port is connected to a nonvirtual block.

ssGetInputPortOptimOptsDetermine the reusability setting of the memory allocated to the input port of an S-function.

ssGetInputPortOverWritable

Determine whether an input port can be overwritten.

ssGetInputPortRealSignal

Get the address of a real, contiguous signal entering an input port.

ssGetInputPortRealSignalPtrs

Access the signal elements connected to an input port.

ssGetInputPortSignal

Get the address of a contiguous signal entering an input port.

ssGetInputPortSignalPtrs

Get pointers to input signal elements of type other than double.

ssGetNumInputPorts

Can be used in any routine (except mdlInitializeSizes) to determine how many input ports a block has.

ssGetNumOutputPorts

Can be used in any routine (except mdlInitializeSizes) to determine how many output ports a block has.

ssGetOutputPortConnectedDetermine whether an output port is connected to a nonvirtual block.

ssGetOutputPortBeingMerged

Determine whether the output of this block is connected to a Merge block.

ssGetOutputPortOptimOptsDetermine the reusability of the memory allocated to the output port of an S-function.

ssGetOutputPortRealSignal

Access the elements of a signal connected to an output port.

ssGetOutputPortSignal

Get the vector of signal elements emitted by an output port.

ssSetInputPortOptimOptsSpecify the reusability of the memory allocated to the input port of an S-function.

ssSetInputPortOverWritable

Specify whether an input port is overwritable by an output port.

ssSetOutputPortOptimOptsSpecify the reusability of the memory allocated to the output port of an S-function.
ssSetOutputPortOverwritesInputPortSpecify whether an output port can share its memory buffer with an input port.

Model Reference

MacroDescription
ssRTWGenIsModelReferenceRTWTargetDetermine if the model reference Real-Time Workshop target is generating.
ssRTWGenIsModelReferenceSIMTargetDetermine if the model reference simulation target is generating.
ssSetModelReferenceNormalModeSupportSpecify if S-function can be used in referenced model simulating in normal mode.
ssSetModelReferenceSampleTimeDefaultInheritanceSpecify that a submodel containing this S-function can inherit its sample time from its parent model.
ssSetModelReferenceSampleTimeDisallowInheritanceSpecify that the use of this S-function in a submodel prevents the submodel from inheriting its sample time from its parent model.

ssSetModelReferenceSampleTimeInheritanceRule

Specify whether use of an S-function in a submodel prevents the submodel from inheriting its sample time from the parent model.

Run-Time Parameters

These macros allow you to create, update, and access run-time parameters corresponding to a block's dialog parameters.

Macro

Description

ssGetNumRunTimeParams

Get the number of run-time parameters created by this S-function.

ssGetRunTimeParamInfo

Get the attributes of a specified run-time parameter.

ssRegAllTunableParamsAsRunTimeParams

Register all tunable dialog parameters as run-time parameters.

ssRegDlgParamAsRunTimeParam

Register a run-time parameter.

ssSetNumRunTimeParams

Specify the number of run-time parameters to be created by this S-function.

ssSetRunTimeParamInfo

Specify the attributes of a specified run-time parameter.

ssUpdateAllTunableParamsAsRunTimeParams

Update all run-time parameters corresponding to tunable dialog parameters.

ssUpdateDlgParamAsRunTimeParam

Update a run-time parameter.

ssUpdateRunTimeParamData

Update the value of a specified run-time parameter.

ssUpdateRunTimeParamInfo

Update the attributes of a specified run-time parameter from the attributes of the corresponding dialog parameters.

Sample Time

Macro

Description

ssGetInputPortSampleTime

Determine the sample time of an input port.

ssGetInputPortSampleTimeIndex

Get the sample time index of an input port.

ssGetNumSampleTimes

Get the number of sample times an S-function has.

ssGetOffsetTimeDetermine one of an S-function's sample time offsets.

ssGetOutputPortSampleTime

Determine the sample time of an output port.

ssGetPortBasedSampleTimeBlockIsTriggered

Determine whether a block that uses port-based sample times resides in a triggered subsystem.

ssGetSampleTimeDetermine one of an S-function's sample times.

ssGetTNext

Get the time of the next sample hit in a discrete S-function with a variable sample time.

ssIsContinuousTask

Determine whether a specified rate is the continuous rate.

ssIsSampleHit

Determine the sample rate at which an S-function is operating.

ssIsSpecialSampleHit

Determine whether the current sample time hits two specified rates.

ssSampleAndOffsetAreTriggered

Determine whether a sample time and offset value pair indicate a triggered sample time.

ssSetInputPortSampleTime

Set the sample time of an input port.

ssSetModelReferenceSampleTimeDefaultInheritanceSpecify that a submodel containing this S-function can inherit its sample time from its parent model.
ssSetModelReferenceSampleTimeDisallowInheritanceSpecify that the use of this S-function in a submodel prevents the submodel from inheriting its sample time from its parent model.

ssSetModelReferenceSampleTimeInheritanceRule

Specify whether use of an S-function in a submodel prevents the submodel from inheriting its sample time from the parent model.

ssSetNumSampleTimes

Set the number of sample times an S-function has.

ssSetOffsetTime

Specify the offset of a sample time.

ssSetSampleTime

Specify a sample time for an S-function.

ssSetTNext

Specify the time of the next sample hit in an S-function.

Simulation Information

Macro

Description

ssGetAbsTol

Get the absolute tolerances used by a model's variable-step solver.

ssGetBlockReduction

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.

ssGetErrorStatus

Get a string that identifies the last error.

ssGetInlineParameters

Determine whether the user has set the inline parameters option for the model containing this S-function.

ssGetSimMode

Determine the context in which an S-function is being invoked: normal simulation, external-mode simulation, model editor, etc.

ssGetSimStatusDetermine the current simulation status.

ssGetSolverMode

Get the solver mode being used to solve the S-function.

ssGetSolverName

Get the name of the solver being used for the simulation.

ssGetStateAbsTol

Get the absolute tolerance used by the model's variable-step solver for a specified state.

ssGetStopRequested

Get the value of the simulation stop requested flag.

ssGetT

Get the current base simulation time.

ssGetTaskTime

Get the current time for a task.

ssGetTFinal

Get the end time of the current simulation.

ssGetTNext

Get the time of the next sample hit.

ssGetTStart

Get the start time of the current simulation.

ssIsExternal

Determine if the model is running in external mode.

ssIsFirstInitCond

Determine whether the current simulation time is equal to the simulation start time.

ssIsMajorTimeStep

Determine whether the current time step is a major time step.

ssIsMinorTimeStep

Determine whether the current time step is a minor time step.

ssIsVariableStepSolver

Determine whether the current solver is a variable-step solver.

ssRTWGenIsAccelerator

Determine if the model is running in Accelerator mode.

ssSetBlockReduction

Request that Simulink attempt to reduce a block.

ssSetSimStateCompliance

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.

ssSetSolverNeedsReset

Ask Simulink to reset the solver.

ssSetStopRequested

Ask Simulink to terminate the simulation at the end of the current time step.

State and Work Vector

Macro

Description

ssGetContStates

Get an S-function's continuous states.

ssGetDiscStates

Get an S-function's discrete states.

ssGetDWork

Get a DWork vector.

ssGetDWorkComplexSignal

Determine whether the elements of a DWork vector are real or complex numbers.

ssGetDWorkDataType

Get the data type of a DWork vector.

ssGetDWorkName

Get the name of a DWork vector.

ssGetDWorkUsageTypeDetermine how the DWork vector is used in S-function.

ssGetDWorkUsedAsDState

Determine whether a DWork vector is used as a discrete state vector.

ssGetDWorkWidth

Get the size of a DWork vector.

ssGetdX

Get the derivatives of the continuous states of an S-function.

ssGetIWork

Get an S-function's integer-valued (int_T) work vector.

ssGetIWorkValue

Get a value from a block's integer work vector.

ssGetModeVector

Get an S-function's mode work vector.

ssGetModeVectorValue

Get an element of a block's mode vector.

ssGetNonsampledZCs

Get an S-function's zero-crossing signals vector.

ssGetNumContStates

Determine the number of continuous states that an S-function has.

ssGetNumDiscStates

Determine the number of discrete states that an S-function has.

ssGetNumDWork

Get the number of data type work vectors used by a block.

ssGetNumIWork

Get the size of an S-function's integer work vector.

ssGetNumModes

Determine the size of an S-function's mode vector.

ssGetNumNonsampledZCs

Determine the number of nonsampled zero crossings that an S-function detects.

ssGetNumPWork

Determine the size of an S-function's pointer work vector.

ssGetNumRWork

Determine the size of an S-function's real-valued (real_T) work vector.

ssGetPWork

Get an S-function's pointer (void *) work vector.

ssGetPWorkValue

Get a pointer from a pointer work vector.

ssGetRealDiscStates

Get the real (real_T) values of an S-function's discrete state vector.

ssGetRWork

Get an S-function's real-valued (real_T) work vector.

ssGetRWorkValue

Get an element of an S-function's real-valued work vector.

ssSetDWorkComplexSignal

Specify whether the elements of a data type work vector are real or complex.

ssSetDWorkDataType

Specify the data type of a data type work vector.

ssSetDWorkName

Specify the name of a data type work vector.

ssSetDWorkUsageTypeSpecify how the DWork vector is used in S-function.

ssSetDWorkUsedAsDState

Specify that a data type work vector is used as a discrete state vector.

ssSetDWorkWidth

Specify the width of a data type work vector.

ssSetIWorkValue

Set an element of a block's integer work vector.

ssSetModeVectorValue

Set an element of a block's mode vector.

ssSetNumContStates

Specify the number of continuous states that an S-function has.

ssSetNumDiscStates

Specify the number of discrete states that an S-function has.

ssSetNumDWork

Specify the number of data type work vectors used by a block.

ssSetNumIWork

Specify the size of an S-function's integer (int_T) work vector.

ssSetNumModes

Specify the number of operating modes that an S-function has.

ssSetNumNonsampledZCs

Specify the number of zero crossings that an S-function detects.

ssSetNumPWork

Specify the size of an S-function's pointer (void *) work vector.

ssSetNumRWork

Specify the size of an S-function's real (real_T) work vector.

ssSetPWorkValue

Set an element of a block's pointer work vector.

ssSetRWorkValue

Set an element of a block's floating-point work vector.

Code Generation

Macro

Description

ssGetDWorkRTWIdentifier

Get the identifier used to declare a DWork vector in code generated from the associated S-function.

ssGetDWorkRTWIdentifierMustResolveToSignalObjectGet a flag indicating if a DWork vector resolves to a Simulink.Signal object.

ssGetDWorkRTWStorageClass

Get the storage class of a DWork vector in code generated from the associated S-function.

ssGetDWorkRTWTypeQualifier

Get the C type qualifier (e.g., const) used to declare a DWork vector in code generated from the associated S-function.

ssGetPlacementGroup

Get the name of the placement group of a block.

ssRTWGenIsCodeGen

Identify any code generation that is not used by the Accelerator.

ssSetDWorkRTWIdentifier

Set the identifier used to declare a DWork vector in code generated from the associated S-function.

ssSetDWorkRTWIdentifierMustResolveToSignalObjectSpecify if a DWork vector resolves to a Simulink.Signal object.

ssSetDWorkRTWStorageClass

Set the storage class of a DWork vector in code generated from the associated S-function.

ssSetDWorkRTWTypeQualifier

Set the C type qualifier (e.g., const) used to declare a DWork vector in code generated from the associated S-function.

ssSetPlacementGroup

Specify the name of the placement group of a block.

ssWriteRTW2dMatParam

Write a Simulink matrix parameter to the S-function's model.rtw file.

ssWriteRTWMx2dMatParam

Write a MATLAB matrix parameter to the S-function's model.rtw file.

ssWriteRTWMxVectParam

Write a MATLAB vector parameter to the S-function's model.rtw file.

ssWriteRTWParameters

Write tunable parameters to the S-function's model.rtw file.

ssWriteRTWParamSettings

Write settings for the S-function's parameters to the model.rtw file.

ssWriteRTWScalarParam

Write a scalar parameter to the S-function's model.rtw file.

ssWriteRTWStr

Write a string to the S-function's model.rtw file.

ssWriteRTWStrParam

Write a string parameter to the S-function's model.rtw file.

ssWriteRTWStrVectParam

Write a string vector parameter to the S-function's model.rtw file.

ssWriteRTWVectParam

Write a Simulink vector parameter to the S-function's model.rtw file.

ssWriteRTWWorkVect

Write the S-function's work vectors to the model.rtw file.

Miscellaneous

Macro

Description

ssCallExternalModeFcn

Invoke the external mode function for an S-function.

ssGetModelName

Get the name of an S-Function block or model containing the S-function.

ssGetParentSS

Get the parent of an S-function.

ssGetPath

Get the path of an S-function or the model containing the S-function.

ssGetRootSS

Return the root (model) SimStruct.

ssGetUserData

Access user data.

ssSetExternalModeFcn

Specify the external mode function for an S-function.

ssSetOptions

Set various simulation options.

ssSetPlacementGroup

Specify the execution order of a sink or source S-function.

ssSetUserData

Specify user data.

  


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