Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

ssIsContinuousTask - Determine whether a task is continuous

Syntax

boolean_T ssIsContinuousTask(SimStruct *S, int_T tid)

Arguments

S

SimStruct representing an S-Function block.

tid

Task ID.

Returns

The Boolean value true when the simulation is executing the continuous task. Otherwise, returns false.

Description

Use in mdlOutputs or mdlUpdate when your S-function has multiple sample times to determine if the task represented by the task ID tid is the continuous task. For example:

    if (ssIsContinuousTask(S, tid)) {
        /* Executing in the continuous task */ 
        if (ssIsSpecialSampleHit(S, 1, 0, tid)) {
            real_T *zoh = ssGetRWork(S);
            real_T *xC  = ssGetContStates(S);
            *zoh = *xC;
        }
    }

You should not use this in single-rate S-functions, or if you did not register a continuous sample time.

Languages

C, C++

Example

See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/src/mixedm.c used in sfcndemo_mixedm.mdl.

See Also

ssSetSampleTime, ssIsSpecialSampleHit

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS