ssSetControllableSampleTime
Register controllable sample time in a block
Syntax
void ssSetControllableSampleTime(Simstruct *S, int st_index, time_T resolution)
Arguments
- S
-
SimStruct that represents anS-Functionblock.
- st_index
-
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. - resolution
-
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
.
Description
Use this function inmdlInitializeSampleTimes
to register the block to be configured to run at a controllable sample time.
语言
C, C++
Examples
Register the S-function block to use controllable sample time at a resolution of 0.01.
staticvoidmdlInitializeSampleTimes(SimStruct* S){ ssSetControllableSampleTime(S, 0, 0.01); }
See the S-functionsfun_pwm.c
used insfcndemo_pwm
Version History
Introduced in R2017b