Main Content

ssGetTFinal

Get the simulation stop time

Syntax

time_T ssGetTFinal(SimStruct *S)

Arguments

S

SimStruct that represents an S-Function block.

Returns

A value of type time_T.

Description

Use to query the stop time of the current simulation. See matlabroot/extern/include/tmwtypes.h for a description of the time_T data type.

For noninlined S-Function blocks, this function behaves in the following ways:

  • For simulation, ssGetTFinal returns the value of Stop time.

  • For code generation,

    • If generation terminates at Stop time, ssGetTFinal returns the value of Stop time.

    • When the Stop time is inf, ssGetTFinal returns the value of —1.

    • If the generated code runs indefinitely and regardless of the value of Stop time, ssGetTFinal returns the value of —1.

Languages

C, C++

Version History

Introduced before R2006a