Получите количество адресатов вызовов функций.
int_T ssGetCallSystemNumFcnCallDestinations(SimStruct *S, int_T elemIdx)
SSimStruct, который представляет блок S-Function
elemIdxНулевой индекс элемента, который выводится на первый выходной порт.
int_T
Используется для определения количества адресатов вызовов функций, когда сигнал вызова функций разделен блоком Function-Call Split.
C, C++
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 */
}
}