ssSetSupportedForCodeReuseAcrossModels
Specify if S-function can be reused across models
Syntax
void ssSetSupportedForCodeReuseAcrossModels(SimStruct *S, int_T val)
Arguments
-
S
-
SimStruct representing an S-Function block.
-
val
-
Either an
int_T (1 or 0)
orboolean_T (true or false)
value.
Description
Use this function inmdlInitializeSizes
method to specify whether you can reuse the S-function inside a reusable library subsystem across the model reference hierarchy.
You must set theSS_OPTION_WORKS_WITH_CODE_REUSE
flag totrue
in thessSetOptions
function.
Configure the S-function for code reuse across models only if the S-function does not access any model-specific data structures. The generated code in_sharedutils
比生成的文件夹分别编译code inmodel_ert_rtw
folder. The reusable library subsystem code generated in the_sharedutils
folder does not have access to types and macros that are declared inmodel.h
. The reusable library subsystem code must be independent.
Languages
C, C++
Example
static void mdlInitializeSizes(SimStruct *S) { ssSetOptions(S,SS_OPTION_WORKS_WITH_CODE_REUSE| SS_OPTION_EXCEPTION_FREE_CODE | SS_OPTION_DISALLOW_CONSTANT_SAMPLE_TIME);ssSetSupportedForCodeReuseAcrossModels(S, 1);}
See Also
ssSetModelReferenceSampleTimeInheritanceRule
,ssSetModelReferenceSampleTimeDisallowInheritance
,ssSetModelReferenceSampleTimeDefaultInheritance
Related Topics
S-Functions for Code Reuse(Simulink Coder)