User`s guide
3 Writing S-Functions As C-MEX files
3-116
Table 3-11: Simulation Information SimStruct Macros
Macro Description
ssGetT(S)
Used in mdlOutputs and mdlUpdate to get the “base” simulation
time. If your S-function doesn’t ha ve a single rate continuous
sample time, then this ti me may not be the “correct task time”
and yourS-function willrun deterministically in amul titasking
environment.
ssGetTaskTime(S,st_index)
Used in mdlOutputs or mdlUpdate to get the task time
corresponding to a sample tim e index.
ssGetTStart(S)
Simulation start time.
ssGetTFinal(S)
Simulationstoptime.
ssIsMinorTimeStep(S)
Used in mdlOutputs to determine if the routine is being called
in a minor time step.
ssIsMajorTimeStep(S)
Used in mdlOutputs to determine if the routine is being called
in a major time step.
ssSetStopRequested(S,val)
Can be called in any simulation loo p routine to speci fy that the
simulation should stop at the end o f the current time step.
ssSetSolverNeedsReset(S)
Used to inform the solvers that the equations which are being
integrated have changed. This macro differs slightly in format
from the other macros in that y ou don’t specify a value; this
was by d esign so that invoking it always requests a reset.