主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

addServiceInterface

在数据字典中创建已命名的服务接口

自 R2022a 起

说明

interface = addServiceInterface(dictionary,name) 将名称 name 指定的服务接口添加到数据字典 dictionary 中。

要删除接口,请使用 removeInterface 函数。

示例

示例

全部折叠

创建数据字典,然后添加名为 newInterface 的服务接口。

dictionary = systemcomposer.createDictionary("new_dictionary.sldd");
interface = addServiceInterface(dictionary,"newInterface")

创建一个新模型,并将数据字典链接到该模型。然后,打开接口编辑器以查看新接口。

arch = systemcomposer.createModel("newModel");
systemcomposer.openModel("newModel");
linkDictionary(arch,"new_dictionary.sldd");

输入参数

全部折叠

数据字典,指定为 systemcomposer.interface.Dictionary 对象。有关如何创建数据字典的信息,请参阅 createDictionary

新服务接口的名称,指定为字符向量或字符串。该名称必须是有效的 MATLAB® 标识符。

示例: "newInterface"

数据类型: char | string

输出参量

全部折叠

新服务接口,以 systemcomposer.interface.ServiceInterface 对象的形式返回。

详细信息

全部折叠

版本历史记录

在 R2022a 中推出