Main Content

ssGetCallSystemNumFcnCallDestinations

Get the number of function-call destinations.

Syntax

int_T ssGetCallSystemNumFcnCallDestinations(SimStruct *S, int_T elemIdx)

Arguments

S

SimStruct that represents an S-Function block

elemIdx

The zero-based element index that is output on the first output port.

Returns

int_T

Description

Use to determine the number of function-call destinations when a function-call signal is split by a Function-Call Split block.

Languages

C, C++

Examples

static void mdlOutputs(SimStruct *S, int_T tid) {
    /* 
     * The second output port outputs the number of blocks 
     * being called to Out3
     */
    real_T *y     = ssGetOutputPortRealSignal(S, 1);
    int_T   numFC = ssGetCallSystemNumFcnCallDestinations(S, 0);
    y[0] = (real_T)numFC;
    UNUSED_PARAMETER(tid);
    /* The first output (function-call port) makes a function-call */
    if (!ssCallSystem(S,0)) {
        /* Error occurred which will be reported by Simulink */
    }
}

Version History

Introduced in R2010a