Register controllable sample time in a block
void ssSetControllableSampleTime(Simstruct *S, int st_index, time_T resolution)
SimStruct representing an S-Function block.
Index of the controllable sample time in the block.
Note
controllable sample time is only supported in single rate
blocks. Hence sti
will be 0.
Sample time resolution of the block. This is the smallest time step
that the block can take. Events of the block can be set to occur at
integral multiples of resolution
.
Use this function in mdlInitializeSampleTimes
to register the
block to be configured to run at a controllable sample time.
C, C++
Register the S-function block to use controllable sample time at a resolution of 0.01.
static void mdlInitializeSampleTimes(SimStruct* S) { ssSetControllableSampleTime(S, 0, 0.01); }
See the S-function sfun_pwm.c
used in sfcndemo_pwm