主要内容

getInterface

获取 Simulink 接口字典中接口的接口对象

自 R2022b 起

在 R2023b 中,引入了数据字典的“架构数据”部分。当管理接口、数据类型、常量和软件寻址方法时,请考虑改用 Simulink.dictionary.ArchitecturalData 编程接口。有关详细信息,请参阅Programmatically Manage AUTOSAR Architectural Data

说明

interfaceObj = getInterface(dictObj,interfaceName) 返回表示接口字典中指定接口的接口对象。

示例

示例

全部折叠

要获取表示指定接口的接口对象,请使用 getInterface 函数。有关显示相关函数工作流的更多信息的示例,请参阅创建和配置接口字典

myInterfaceObj = getInterface(dictAPI,'DataInterface')
myInterfaceObj = 

  DataInterface with properties:

           Name: 'DataInterface'
    Description: ''
       Elements: [1×3 Simulink.interface.dictionary.DataElement]
          Owner: [1×1 Simulink.interface.Dictionary]

输入参数

全部折叠

接口字典,指定为 Simulink.interface.Dictionary 对象。在使用此函数之前,请使用 Simulink.interface.dictionary.createSimulink.interface.dictionary.open 创建或打开 dictObj

dictObjInterfaces 属性数组中的 interfaceName 定义名称,指定为字符向量或字符串标量。

示例: 'DataInterface'

输出参量

全部折叠

接口对象,以 Simulink.interface.dictionary.DataInterfaceSimulink.interface.dictionary.ServiceInterface 对象形式返回。

版本历史记录

在 R2022b 中推出

全部折叠