Writing S-Functions | ![]() ![]() |
Initialize the state vectors of this S-function.
Syntax
Arguments
S
SimStruct representing an S-Function block.
Description
Simulink invokes this optional method at every major integration step to get the time of the next sample time hit. This method should set the time of next hit, using ssSetTNext
. The time of the next hit must be greater than the current simulation time as returned by ssGetT
. The S-function must implement this method if it operates at a discrete, variable-step sample time.
Languages
Example
static void mdlGetTimeOfNextVarHit(SimStruct *S) { time_T offset = getOffset(); time_T timeOfNextHit = ssGetT(S) + offset; ssSetTNext(S, timeOfNextHit); }
See Also
mdlInitializeSampleTimes, ssSetTNext, ssGetT
![]() | mdlDerivatives | mdlInitializeConditions | ![]() |