S功能功能and Limitations
S功能功能
以下表概述了由不同类型的S功能支持的功能。金宝app第一张表侧重于手写的S功能。第二个表比较了S功能构建器或旧版代码工具自动生成的S功能的功能。
手写S功能的功能
特征 | 1级MATLAB S功能 | Level-2 MATLAB S-Function | Handwritten C MEX S-Function |
---|---|---|---|
Data types | 金宝app支持具有数据类型的信号double 。 |
金宝app支持Simulink支持的任何数据类型金宝app®软件,包括定点类型。 | 金宝app支持Simulink软件支持的任何数据类型,包括定点类型。金宝app |
数字类型 | 金宝app仅支持real signals. | 金宝app支持真实和复杂的信号。 | 金宝app支持真实和复杂的信号。 |
框架支持金宝app | 不支持基于框架的信金宝app号。 | 金宝app支持框架和无框信号。 | 金宝app支持框架和无框信号。 |
Port dimensions | 金宝app支持向量输入和输出。不支持多个输入和输金宝app出端口。 | 金宝app支持标量,1-D和多维输入和输出信号。 | 金宝app支持标量,1-D和多维输入和输出信号。 |
S-function API | 金宝app仅支持mdlInitializeSizes ,,,,mdlDerivatives ,,,,mdlUpdate ,,,,mdlOutputs ,,,,mdlGetTimeOfNextVarHit ,,,,andmdlTerminate 。 |
金宝app支持较大的S功能API集。看Level-2 MATLAB S-Function Callback Methods有关支持方法的列表。金宝app | 金宝app支持the entire S-function API. |
Code generation support | Does not support code generation. | 需要一个手written TLC file to generate code. | 本机支持的代码生成金宝app。需要一个手written TLC file to inline the S-function during code generation. |
Simulink Accelerator mode | Runs interpretively and is, therefore, not accelerated. | 提供了在加速器模式下使用TLC文件的选项,而不是解释性运行。 | 提供在加速器模式下使用TLC或MEX文件的选项。 |
模型参考 | Cannot be used in a referenced model. | 金宝app支持Normal and Accelerator mode simulations when used in a referenced model. Requires a TLC file for Accelerator mode. | 在引用模型中使用时,提供了样本时间继承和正常模式支持的选项。金宝app看模型参考要求和局限性 |
金宝appSimulink。 and金宝appSimulink。 金宝app |
不支持这些课程。金宝app | 金宝app支持金宝appsimulink.numerictype and金宝appsimulink.Airstype classes (see配置自定义数据类型). |
金宝app支持所有这些课程(请参阅配置自定义数据类型). |
总线输入和输出信号 | Does not support bus input or output signals. | Does not support bus input or output signals. | 金宝app支持nonvirtual bus input or output signals. |
可调和运行时参数 | 金宝app支持tunable parameters during simulation. Does not support run-time parameters. | 金宝app支持可调和运行时参数。 | 金宝app支持可调和运行时参数。 |
Work vectors | 不支持工作向量。金宝app | 金宝app支持DWork vectors (see在2级MATLAB S函数中使用DWORD向量). | 金宝app支持all work vector types (seeTypes of DWork Vectors). |
特征s of Automatically Generated S-Functions
特征 | S-Function Builder | 旧版代码工具 |
---|---|---|
Data types | 金宝app支持Simulink软件支持的任何数据类型,包括定点类型。金宝app | 金宝app支持all built-in data types. To use a fixed-point data type, you must specify the data type as a金宝appsimulink.numerictype 。You cannot use a fixed-point type with unspecified scaling. |
数字类型 | 金宝app支持真实和复杂的信号。 | 金宝app支持complex signals only for built-in data types. |
框架支持金宝app | 金宝app支持框架和无框信号。 | 不支持基于框架的信金宝app号。 |
Port dimensions | 金宝app支持标量,1-D和多维输入和输出信号。 | 金宝app支持标量,1-D和多维输入和输出信号。 |
S-function API | 金宝app支持creation of custommdlInitializeSizes ,,,,mdlInitializeSampleTimes ,,,,mdlDerivatives ,,,,mdlUpdate ,,,,andmdlOutputs 。Also allows for automatic generation ofmdlstart andmdlTerminate 。 |
金宝app支持mdlInitializeSizes ,,,,mdlInitializeSampleTimes ,,,,mdlstart ,,,,mdlinitializeconditions ,,,,mdlOutputs ,,,,andmdlTerminate 。 |
Code generation support | 本机支持的代码生成金宝app。另外,自动生成一个TLC文件,用于在代码生成过程中嵌入s功能。 | 本地支持针对嵌入式金宝app系统优化的代码生成。此外,自动生成一个TLC文件,该文件支持表达式折叠,以插入代码生成过程中的s功能。金宝app |
金宝appSimulink Accelerator™mode |
Uses a TLC file in Accelerator mode, if the file was generated. Otherwise, uses the MEX file. | 提供在加速器模式下使用TLC或MEX文件的选项。 |
模型参考 | Uses default behaviors when used in a referenced model. | Uses default behaviors when used in a referenced model. |
金宝appsimulink.Airstype and金宝appsimulink.numerictype |
不支持这些课程。金宝app | 金宝app支持金宝appsimulink.Airstype and金宝appsimulink.numerictype 。 |
总线输入和输出信号 | 金宝app支持总线输入和输出信号。看sfbuilder_bususage例如。 | 金宝app支持总线输入和输出信号。你必须定义一个金宝appsimulink.bus MATLAB中的对象®workspace that is equivalent to the structure of the input or output used in the legacy code. Does not support bus parameters. |
可调和运行时参数 | 金宝app仅在模拟过程中支持可调参数。金宝app支持运行时参数。 | 金宝app支持可调和运行时参数。 |
Work vectors | 不提供对矢量的访问。 | 金宝app支持使用类型的DWork向量SS_DWORK_USED_AS_DWORK 。看Types of DWork Vectors有关不同DWork矢量使用类型的讨论。 |
S-Function Limitations
The following table summarizes the major limitations of the different types of S-functions.
Implementation | Limitations |
---|---|
1级MATLAB S功能 | Does not support the majority of S-function features. See theS功能功能and Limitations有关级别1 MATLAB S功能功能的信息的部分,请支持。金宝app |
2级MATLAB S功能 |
|
Handwritten C MEX S-function | 金宝app支持model reference with some limitations. SeeS-Functions in Referenced Models。 |
S-Function Builder |
笔记带有一个输入和一个输出端口的S函数可以具有动态大小的信号 |
旧版代码工具 |
|