For additional information, see Model Referencing Limitations.
When a C S-function appears in a referenced model that executes in Normal mode, successful execution is impossible if all of the following are true:
The S-function has both an
depends on the
The referenced model calls
Execution fails because
dependency requirements that
mdlStart has not satisfied.
Automated analysis cannot guard against all possible causes of such
failure: you must check your code manually and verify that
not in any way dependent on
mdlStart being called
first. Examples of such dependency include:
Allocating memory in
using that memory in
is often done using
Initializing any DWork or any global memory in
reading the values in
To remind you to check for any such dependency problems, an
error message appears by default for any S-function that is used in
a Normal mode referenced model and contains both an
mdlStart function. The error message does
not mean that any dependency problems exist, but only that they might
If you get such an error message, check for any problematic
dependencies in the S-function, and recode as needed to eliminate
them. When no such dependencies exist, you can safely suppress the
error message and use the S-function in a Normal mode referenced model.
To certify that the S-function is compliant, and the message is therefore
unnecessary, include the following statement in
ssSetModelReferenceNormalModeSupport (S, MDL_START_AND_MDL_PROCESS_PARAMS_OK);
For information about referenced models, see Overview of Model Referencing.
You may need to modify S-functions that are used by a model
so that the S-functions work with multiple instances of referenced
models in Normal mode. The S-functions must indicate explicitly that
they support multiple
For C S-functions, use
For MATLAB® file S-functions, use
The limitations for using S-functions with multiple instances of referenced models in Normal mode are the same as the limitations that apply to using S-functions with For Each Subsystem block.