ssGetSampleTime
Get one of an S-function's sample times.
Syntax
time_T ssGetSampleTime(SimStruct *S, int_T sti);
Arguments
SSimStruct that represents an S-Function block.
stiIndex of the sample time to be returned.
Returns
A time_T value indicating the sample time associated with the
index sti.
Description
Use to obtain the sample time of S corresponding to the sample
time index sti. See
for a description of the
matlabroot/extern/include/tmwtypes.htime_T data type.
Note
You cannot call this macro in S-functions that only use port-based sample
times. You should use the macros and ssGetInputPortSampleTime.ssGetOutputPortSampleTime
Note
Using ssGetSampleTime for computations can make your
S-function sample time dependent. Use
so that Simulink® displays an error when your S-function is used in an inappropriate
context.ssSetModelReferenceSampleTimeDisallowInheritance
Languages
C, C++
Examples
The following statement
time_T t = ssGetSampleTime(S, 0);
returns the S-function's current sample time.
See the S-function sfun_zc_sat.c used in sfcndemo_sfun_zc_sat for a complete example that uses this
function.
See Also
Version History
Introduced before R2006a