| Contents | Index |
int_T ssGetCallSystemNumFcnCallDestinations(SimStruct *S, int_T elemIdx)
SimStruct that represents an S-Function block
The zero-based element index that is output on the first output port.
int_T
Use to determine the number of function-call destinations when a function-call signal is split by a Function-Call Split block.
C, C++
In this example model, a user-defined S-function block outputs a function-call signal on its first port and queries the number of function-call destinations via its second output port and a call to ssGetCallSustemNumFcnCallDestinations(S, 0). The signal is split by a Function-Call Split block and then calls two function-call destinations: f and h. Output port Out3 correctly outputs 2.
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 */
/* Not true, Simulink does not report it*/
}
}
Function-Call SplitFunction-Call Subsystems

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |