You can integrate existing C (or C++) functions, such as device drivers, lookup tables, and general functions and interfaces, into Simulink®模型通过使用遗留代码的工具。使用北方联盟党cy Code Tool to specify the name of the S-function, files, and path required for the compilation, and options for the generated S-function.
使用LEGACY_CODE
函数以生成s功能,编译并链接生成的S功能,并创建用于调用生成的S功能的掩码。
在您可以使用之前LEGACY_CODE
,确保为您的MATLAB设置C编译器®安装。
LEGACY_CODE |
使用旧代码工具 |
Integrate C Functions Using Legacy Code Tool
使用旧版代码工具从现有的C代码自动生成S函数。
使用手写C MEX函数,S功能构建器和旧版代码工具合并旧版C代码。
利用MATLAB功能调用外部C代码并控制枚举和总线Typedefs的块。