模型参考
重用模型作为其他模型中的块
一个model reference是使用一个模型的引用Model堵塞。这些引用创建模型层次结构。每个引用模型都有一个定义的接口,该接口指定其输入和输出的属性。定义的接口使参考模型的行为独立于模型层次结构中的上下文。对于仿真和代码生成,当父模型执行时,引用的模型像单个块或原子单元一样执行。模型参考是代码重复使用,单元测试,并行构建和大型组件的理想选择。他们还可以减少文件争论并合并问题。
To determine whether referenced models meet your modeling requirements, see基于组件的建模准则。
To learn about code generation for model reference hierarchies, seeReferenced Models(万博1manbetxSimulink编码器)。
To create a protected model, seeModel Protection(万博1manbetxSimulink编码器)。
Blocks
Model | Reference another model to create model hierarchy |
Variant Model | Template subsystem containing Subsystem, Model, or Subsystem Reference blocks as variant choices |
功能
模型设置
Tools
型号参考转换顾问 | Convert subsystems to referenced models |
Referenced Files Pane | View, save, and close referenced subsystems and models |
话题
Determine When to Reference Models
- 基于组件的建模准则
考虑大型模型和多源开发团队的组件。 - Model Reference Basics
通过在另一个模型中引用一个模型来创建模型层次结构。引用的模型包含将作为单元执行的块。 - 模型参考要求和局限性
Model references have requirements and limitations relating to features such as reusability, simulation modes, masking, and debugging.
Create Model References
- Reference Existing Models
在另一个模型中包括模型。 - 来自第三方的参考保护模型
Use a protected model that you received from a third party. - 将子系统转换为参考模型
Prepare a subsystem for conversion, convert the subsystem to a model, and compare simulation results before and after conversion. - 模型参考接口和边界
Ports in the referenced model correspond with ports at the model reference. Signals that cross the model boundary must meet certain requirements. - Inspect Model Hierarchies
检查模型层次结构中的内容,结构,模型版本和已记录的信号。
Configure Model References
- Set Configuration Parameters for Model Hierarchies
配置参数的值可以是不同的top models and referenced models. Some configuration parameter values have special requirements or behavior with model referencing. - Conditionally Execute Referenced Models
有条件地执行引用的模型,类似于有条件执行的子系统。 - Referenced Model Sample Times
一个referenced model can inherit sample times from the model that references it. - 可重复使用的参考模型的参数化实例
当您将可重复使用的组件建模为引用模型时,以配置组件的每个实例以对块参数使用不同的值,请创建模型参数。 - Parameterize a Referenced Model Programmatically
This example shows how to programmatically configure multiple instances of a referenced model to use different values for the same block parameter. - Group Multiple Model Arguments into a Single Structure
此示例显示了如何通过使用结构来编程配置引用模型的多个实例,以使用不同的值对相同的块参数使用不同的值。 - 通过编程配置查找表的实例特定数据
当您使用时万博1manbetxsimulink。可见
objects to store and configure lookup table data for ASAP2 or AUTOSAR code generation (for example, STD_AXIS or CURVE), you can configure the objects as model arguments.
模拟模型层次结构
- 选择模型层次结构的仿真模式
在模型层次结构中选择模型的仿真模式。 - 管理引用模型的仿真目标
模拟目标或SIM目标是MEX文件,它实现了在加速器模式下执行的引用模型。 - Share Simulink Cache Files for Faster Simulation
使用Si万博1manbetxmulink缓存文件共享构建工件,使您避免首次构建的成本。 - 通过使用并行构建减少引用模型的更新时间
通过使用并行构建减少图表更新时间的大型参考层次结构。 - 模拟有条件执行的引用模型
Run a standalone simulation of a conditionally executed referenced model. - 在正常模式下模拟多个引用的模型实例
Simulate a model that contains multiple instances of a referenced model.
相关信息
- Component-Based Modeling
- 大型建模
- 变体系统
- Referenced Models(万博1manbetxSimulink编码器)
- Model Protection(万博1manbetxSimulink编码器)