Contents

Sample Time

Configure sample time for S-Function blocks

S-Function Callback Methods

mdlInitializeSampleTimes Specify the sample rates at which this C MEX S-function operates
mdlInitializeSizes Specify the number of inputs, outputs, states, parameters, and other characteristics of the C MEX S-function
mdlSetInputPortSampleTime Set the sample time of an input port that inherits its sample time from the port to which it is connected
mdlSetOutputPortSampleTime Set the sample time of an output port that inherits its sample time from the port to which it is connected

SimStruct Functions

ssSetSampleTime Set the period of a sample time
ssSetInputPortSampleTime Specify the sample time of an input port
ssSetModelReferenceSampleTimeDefaultInheritance Specify that a referenced model containing this S-function can inherit its sample time from its parent model
ssSetModelReferenceSampleTimeDisallowInheritance Specify that the use of this S-function in a referenced model prevents the referenced model from inheriting its sample time from its parent model
ssSetModelReferenceSampleTimeInheritanceRule Specify whether use of this S-function in a referenced model prevents the referenced model from inheriting its sample time from its parent model
ssSetNumSampleTimes Specify the number of sample times that an S-Function block has
ssSetOffsetTime Set the offset time of a block
ssSetTNext Set the time of the next sample hit
ssGetInputPortSampleTime Get the sample time of an input port
ssGetInputPortSampleTimeIndex Get the sample time index of an input port
ssGetNumSampleTimes Get the number of sample times that a block has
ssGetOffsetTime Get one of an S-function's sample time offsets.
ssGetOutputPortSampleTime Get the sample time of an output port
ssGetOutputPortSampleTimeIndex Get sample time index of output port
ssGetPortBasedSampleTimeBlockIsTriggered Determine whether a block that uses port-based sample times resides in a triggered subsystem
ssGetSampleTime Get one of an S-function's sample times.
ssGetTNext Get the time of the next sample hit
ssIsContinuousTask Determine whether a task is continuous
ssIsSampleHit Determine whether the sample time is hit
ssIsSpecialSampleHit Determine whether the sample time is hit
ssSampleAndOffsetAreTriggered Determine whether a sample time and offset value pair indicate a triggered sample time
ssSampleAndOffsetAreTriggeredOrAsync Determine whether a sample time and offset value pair indicate a triggered or asynchronous sample time

Examples and How To

Was this topic helpful?