Main Content

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. Hencestiwill 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 ofresolution.

Description

Use this function inmdlInitializeSampleTimesto 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.cused insfcndemo_pwm

Version History

Introduced in R2017b