legacy_code
Integrate existing C/C++ code using Legacy Code Tool
Syntax
Description
legacy_code("help")
displays instructions for using Legacy Code
Tool.
initializes
the Legacy Code Tool data structure, specs
= legacy_code("initialize")specs
, which registers
characteristics of existing C or C++ code and properties of the S-function that the Legacy
Code Tool generates.
legacy_code("sfcn_cmex_generate",
generates an S-function source file as specified by the Legacy Code Tool data structure,
specs
)specs
.
legacy_code("compile",
compiles and links the S-function generated by the Legacy Code Tool based on the data
structure, specs
,compilerOptions
)specs
and compiler options that you specify. The compiler
options must be supported by the mex function.
legacy_code("slblock_generate",
generates a masked S-Function block for the S-function generated by the Legacy Code Tool
based on the data structure, specs
,modelname
)specs
. The block appears in the
Simulink® model specified by modelname
. If you omit
modelname
, the block appears in an empty model editor window.
legacy_code("sfcn_tlc_generate",
generates a TLC file for the S-function generated by the Legacy Code Tool based on the data
structure, specs
)specs
. This option is relevant if you want to:
Force accelerator mode simulation to use the TLC inlining code of the generated S-function. See the description of the
ssSetOptions
SimStruct
function and theSS_OPTION_USE_TLC_WITH_ACCELERATOR
S-function option for more information.Use Simulink Coder™ software to generate code from your Simulink model. For more information, see Import Calls to External Code into Generated Code with Legacy Code Tool (Simulink Coder).
legacy_code("sfcn_makecfg_generate",
generates an specs
)sFunction
_makecfg.m
file for the
S-function generated by the Legacy Code Tool based on the data structure,
specs
. If you use Simulink
Coder to generate code from your Simulink model, you can use this option to specify additional items for the S-function
build process such as source folders, preprocessor macros, and link objects. For example,
you can specify source files that the S-function depends on that are in folders other than
the folder containing the generated S-function executable. For more information, see Use makecfg to Customize Generated Makefiles for S-Functions (Simulink Coder) and Import Calls to External Code into Generated Code with Legacy Code Tool (Simulink Coder).
legacy_code("rtwmakecfg_generate",
generates an specs
)rtwmakecfg.m
file for the S-function generated by the Legacy
Code Tool based on the data structure, specs
. If you use Simulink
Coder to generate code from your Simulink model, you can use this option to specify additional items for the S-function
build process such as source folders, preprocessor macros, and link objects. For example,
you can specify source files that the S-function depends on that are in folders other than
the folder containing the generated S-function executable. For more information, see Use rtwmakecfg.m API to Customize Generated Makefiles (Simulink Coder) and Import Calls to External Code into Generated Code with Legacy Code Tool (Simulink Coder).
legacy_code("backward_compatibility")
automatically updates syntax
for using Legacy Code Tool to the supported syntax described in this reference page and in
Integrate C Functions Using Legacy Code Tool.
Examples
Input Arguments
Version History
Introduced in R2006b