Main Content

linkTomodel

Link component to model

Description

例子

modelHandle= linkToModel(零件,,,,modelNamelinks from the component to a model or subsystem.

modelHandle= linkToModel(零件,,,,ModelfilEname从组件到由其完整文件名定义的模型或子系统的链接,SLXorSLXPextension.

Examples

collapse all

保存命名的组件robotCompin the architecture modelRobot.slxand reference it from another component namedelectricComp使组件electricCompuses the architecture of the componentrobotComp

创建模型archModel.slx

model = systemcomposer.createmodel(“ ArchModel”,真的);Arch = Get(型号,“建筑学”);

一个dd two components to the model with the nameselectricCompandrobotComp

名称= ["electricComp",,,,“ RobotComp”]; comp = addComponent(arch,names);

SaverobotCompin theRobot.slx模型因此,组件参考模型。

saveAsModel(comp(2),"Robot");

Link theelectricComp零件to the same modelRobot.slxso it uses the architecture of the originalrobotComp零件and references the architecture modelRobot.slx

linkTomodel(comp(1),"Robot");

Clean up the model.

金宝appsimulink.blockdiagram.arangesystem(“ ArchModel”);

Input Arguments

collapse all

没有子组件的组件,指定为systemcomposer.arch.Componentobject.

Model or subsystem name for an existing model or subsystem that defines the architecture or behavior of the component, specified as a character vector or string. Models or subsystems of the same name prioritize protected models with theSLXPextension.

Example:"Robot"

数据类型:char|细绳

Model or subsystem file name for an existing model or subsystem that defines the architecture or behavior of the component, specified as a character vector or string.

Example:"Model.slx"

Example:“ preatectedModel.slxp”

数据类型:char|细绳

输出参数

collapse all

处理链接模型或子系统,作为数字值返回。

数据类型:double

更多关于

collapse all

定义

学期 Definition 一个pplication 更多信息
architecture

系统作曲家™architecture代表组件系统以及它们如何在结构和行为上相互接口。您可以使用替代视图表示特定的体系结构。

不同类型的体系结构描述了系统的不同方面:

  • Functional architecturedescribes the flow of data in a system.

  • 逻辑架构描述系统的预期操作。

  • 物理体系结构描述系统中的平台或硬件。

在视觉上撰写体系结构
model

系统作曲家modelis the file that contains architectural information, including components, ports, connectors, interfaces, and behaviors.

在模型上执行操作:

  • Extract the root-level architecture contained in the model.

  • 应用轮廓。

  • Link interface data dictionaries.

  • 从模型体系结构生成实例。

系统作曲家模型存储为SLX文件。

Create Architecture Model with Interfaces and Requirement Links
零件

一个零件是在体系结构中实现明确功能的系统的一个非平凡,几乎独立且可更换的部分。组件定义了构建元素,例如功能,系统,硬件,软件或其他概念实体。组件也可以是子系统或子函数。

组件表示为块,是可以将可重复使用的伪像的体系结构模型的一部分。

零件s
港口

一个港口is a node on a component or architecture that represents a point of interaction with its environment. A port permits the flow of information to and from other components or systems.

There are different types of ports:

  • 零件港口s是其他组件的组件上的交互点。

  • 一个rchitecture ports是系统边界上的端口,无论边界在组件内还是整体体系结构模型内。

Ports
connector

Connectorsare lines that provide connections between ports. Connectors describe how information flows between components or architectures.

连接器允许两个组件进行交互,而无需定义交互的性质。在端口上设置一个接口以定义组件如何交互。

连接

学期 Definition 一个pplication 更多信息
reference component

一个reference component是一个组件,其定义是单独的体系结构模型,Simulink金宝app®行为模型或模拟子系统行为。金宝app参考组件代表其他组合物的逻辑层次结构。

您可以使用参考组件在模型中重复使用构图。参考组件有三种类型:

  • 模型参考Sim是ulink models.

  • 子系统参考Sim是ulink subsystems.

  • 一个rchitecture referencesare System Composer architecture models.

parameter definition

一个parameter definitionis the definition of a property that has instance semantics. A parameter definition specifies attributes such as name, data type, default value, and units.

参数定义可以指定为Simulink模型或系统作曲家体系结构模型上的模型参数。金宝app

访问模型参数作为参考组件上的参数
parameter

一个parameter是参数定义的实例特定值。参数捕获实例特定的值和单位。

参数可用于链接到指定模型参数的模型参考或体系结构参考的每个组件。您可以在每个组件上指定一个参数的独立值。

使用参数将实例值与组件存储
子系统组件

一个子系统组件是一个Si金宝appmulink子系统,是父系统作曲家体系结构模型的一部分。

一个dd Simulink subsystem behavior to a component to author a subsystem component in System Composer. You cannot synchronize and reuse subsystem components asReference Component块是因为组件是父模型的一部分。

状态图

一个状态图diagram demonstrates the state-dependent behavior of a component throughout its state lifecycle and the events that can trigger a transition between states.

添加状态流®chart behavior to describe a component using state machines. You cannot synchronize and reuse Stateflow chart behaviors asReference Component块是因为组件是父模型的一部分。

版本历史记录

在R2019a中引入