主要内容

有条件地执行的子系统概述

一种有条件地执行的子系统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支持这些类型的条件子系统:

  • 启用子系统— Executes at each time step while 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使用函数呼叫子系统

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

  • 一次在当前时间步骤启用时,由控制块启用。控制块实现类似于由编程语言语句表示的控制逻辑,例如if-thel-elseorswitch

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

  • 在接收函数呼叫事件时,在时间步长一次或多次。

金宝app使用2个输出端口的IF块的Simulink画布,每个输出端口通过虚线连接到单独的IF动作子系统块的操作端口。如果Action子系统块连接到合并块,则每个输出,其输出连接到Outport块。IF块的输入,如果Action子系统块连接到Inport Blocks。

金宝appSimulink Canvas显示2个型号。在第一个模型中,有2个支持的子系统块。InPort块Lableled“Enable信号”连接到一个支持的子系统块的控制端口,并不块,其输出连接到另一个支持的子系统块。启用的子系统块的输出连接到合并块。在第二种模型中,标记为“函数调用事件”的Inport块连接到标记为“EnableD_Model”的模型块的控制端口。

模型例子

也可以看看

相关例子

更多关于