Main Content

ssSetTimeSource

Set source of time for asynchronous task

Syntax

void ssSetTimeSource(SimStruct *S, slTimeSource timeSource)

Arguments

S

SimStruct that represents an S-Function block.

timeSource

Source of time used by the asynchronous task created by the block.

Description

Use this function in mdlInitializeSizes to specify the source of the time used by an asynchronous task created by S. The allowed values for timeSource are:

  • SS_TIMESOURCE_BASERATE— block reads the absolute time from the base rate

  • SS_TIMESOURCE_SELF—block sets its own time

  • SS_TIMESOURCE_CALLER—block uses time from an upstream block that triggers the asynchronous task

  • SS_TIMESOURCE_SELF_INTERNAL—if the asynchronous task also executes periodically, block maintains an internal timer by incrementing at each execution.

Languages

C, C++

Examples

static void mdlInitializeSizes(SimStruct *S)
{
    ssSetTimeSource(S, SS_TIMESOURCE_SELF);
}

Version History

Introduced before R2006a