| Contents | Index |
void ssSupportsMultipleExecInstances(SimStruct *S, boolean_T val)
SimStruct representing an S-Function block.
A string have a value of either true or false. If true, then the For Each Subsystem will support having an S-function operate inside of it.
Allows an S-function block to operate from within a For Each Subsystem block. It is best to call this macro from the mdlSetWorkWidths function.
C, C++
In this example, the ssSupportsMultipleExecInstances function resides inside mdlInitializeSize. Basically, if a block unconditionally supports or does not support a For Each subsystem, the function can be used inside mdlInitializeSize. If the decision relies on the compiled information, however, then this function should be used inside mdlSetWorkWidths.
static void mdlInitializeSizes(SimStruct *S)
{
ssSetNumDiscStates(S, 0); /* no default dstate */
if (!ssSetNumInputPorts(S, 1)) return;
ssSetInputPortWidth(S, 0, 1);
if (!ssSetNumOutputPorts(S, 1)) return;
ssSetOutputPortWidth(S, 0, 1);
ssSetNumRWork(S, 0);
ssSetNumDWork(S, 1);
ssSetNumIWork(S, 0);
ssSetNumPWork(S, 0);
ssSetNumModes(S, 0);
ssSetDWorkWidth(S, 0, 1);
ssSetDWorkUsedAsDState(S, 0, SS_DWORK_USED_AS_DSTATE);
ssSetDWorkName(S, 0, "State");
ssSetOptions(S, SS_OPTION_EXCEPTION_FREE_CODE |
SS_OPTION_WORKS_WITH_CODE_REUSE |
SS_OPTION_USE_TLC_WITH_ACCELERATOR);
ssSupportsMultipleExecInstances(S, true);
}
mdlSetWorkWidths, For Each Subsystem

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 |