Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

ssGetSampleTime

Get one of an S-function's sample times.

Syntax

time_T ssGetSampleTime(SimStruct *S, int_T sti);

Arguments

S

SimStruct representing an S-Function block.

sti

Index of the sample time to be returned.

Returns

A time_T value indicating the sample time associated with the index sti.

Description

Use to obtain the sample time of S corresponding to the sample time index sti. See matlabroot/extern/include/tmwtypes.h for a description of the time_T data type.

    Note   Using ssGetSampleTime for computations can make your S-function sample time dependent. Use ssSetModelReferenceSampleTimeDisallowInheritance so that Simulink® displays an error when your S-function is used in an inappropriate context.

Languages

C, C++

Example

The following statement

time_T t = ssGetSampleTime(S, 0);

returns the S-function's current sample time.

See the S-function sfun_zc_sat.c used in sfcndemo_sfun_zc_sat for a complete example that uses this function.

Introduced before R2006a

Was this topic helpful?