主要内容

有条件执行的子系统概述

一个有条件执行的子系统is a nonvirtual subsystem that allows you to control its execution with an external signal. The external signal, called the控制信号,附着在控制输入港口。当您创建包含执行取决于其他组件的组件的复杂模型时,有条件的子系统将很有用。

Simulink canvas with Conditionally Executed Subsystem block. Subsystem block has control input port at the top and data input port at the left, both connected to Inport blocks. Subsystem block has data output port at the right, connected to an Outport block.

金宝app®金宝app支持这些类型的条件子系统:

  • 在每个时间步whi启用子系统——执行le the control signal is positive. Execution starts at the time step when the control signal crosses zero from the negative to the positive direction. See使用启用子系统

  • 触发子系统 - 在控制信号上升或跌至零或越过零时,在每个时间步骤执行。看使用触发的子系统

  • 启用和触发子系统— Executes at the time step when the enable control signal has a positive value and the trigger control signal rises or falls to zero. See使用启用和触发子系统

  • 消息触发的子系统 - 使用消息作为控制信号,并在控制端口可用时执行,而与块示例时间无关。看使用消息轮询和消息触发子系统

  • 消息轮询子系统 - 使用消息作为控制信号,并在控制端口可用消息时在每个时间步骤执行。看使用消息轮询和消息触发子系统

  • 功能通话子系统 - 当控制信号接收函数通话事件时执行。在时间步长期间可能发生一个或多个时间。状态流®chart,函数通话发生器堵塞,S功能街区,或点击十字路口block can provide function-call events. See使用功能通话子系统

有条件执行的子系统或有条件执行的引用模型运行:

  • 在当前时间步骤中,当由控制块启用时。控制块实现控制逻辑,类似于编程语言语句所表达的逻辑,例如如果是elseorswitch

  • 在当前时间步长启用或由控制信号触发时,一次。

  • 接收功能通话事件时的时间步长一次或多次。

金宝app使用2个输出端口的IF模块simulink canvas,每个端口都通过虚线连接到单独的IF Action子系统块的动作端口。如果操作子系统块连接到合并块,将其输出连接到外口块。IF块的输入和IF Action子系统块都连接到Inport块。

金宝appSimulink帆布显示2个型号。在第一个模型中,有2个启用的子系统块。一个内部块的“启用信号”连接到一个启用子系统块的控制端口,并连接到其输出连接到其他启用子系统块的非块。两个启用子系统块的输出连接到合并块。在第二个模型中,将标有“功能通话事件”的Inport块连接到标有“ Enebable_Model”的模型块的控制端口。

模型示例

也可以看看

相关示例

更多关于