Trigger

添加触发器或功能端口子系统或模型

  • 图书馆:
  • Simulink / Ports & Subsystems

    HDL编码器/端口和子系统

描述

Triggerblock adds an external signal to control the execution of a subsystem or a model. To enable this functionality, add this block to a子系统块或在模型的根级别是在引用模型块。

然后,配置Trigger块以执行子系统或模型:

  • Once at each time step, when the value of the control signal changes in a way that you specify.

  • Multiple times during a time step, when the control signal is a function-call event from a Stateflow®图表,函数调用发生器块,或S-Function块。

端口

产量

展开全部

值,该值标识的控制信号,返回为标量或矢量。对于输入信号中的每个元素,在给定的时间步长的值是:

  • 1为导致上升触发的信号

  • -1为导致下降触发的信号

  • 2一个函数调用事件

  • 0在所有其他情况

依赖

要启用该端口,请选择显示输出端口

数据类型:|int8

参数

展开全部

Main

选择the type of control signal that executes a subsystem or model.

rising

当控制信号从负值或零值到正值上升子系统或模型的触发器执行。如果初始值是负的,上升信号到零触发执行。

Falling

触发器的执行中高tem or model when the control signal falls from a positive or a zero value to a negative value. If the initial value is positive, a falling signal to zero triggers execution.

触发器的执行中高tem or model when the control signal is either rising or falling.

函数调用

执行子系统或当控制信号从一个状态流图表接收函数调用事件建模,函数调用发生器块,或S-功能块。

程序中使用

块参数:TriggerType
类型:特征向量
价值观:'rising'|“下降”|'either'|“函数调用”
默认:'rising'

Create a万博1manbetxSimulink的功能通过配置方框子系统block that is callable with arguments from a function caller.

删除配置。

配置一子系统块作为万博1manbetxSimulink的功能块。该Trigger块必须驻留在子系统内。

您可以编辑功能的原型,在块面显示为块指定输入和输出参数。

Dependency

To display and enable this parameter, select函数调用来自触发类型list.

程序中使用

块参数:Is万博1manbetxSimulinkFunction
类型:特征向量
价值观:“关”|'上'
默认:“关”

指定一个函数名万博1manbetxSimulink的功能块。或者,您可以通过编辑块面的函数原型指定的名称。

F

对于默认名称万博1manbetxSimulink的功能块。

函数名

函数名称在面对显示器万博1manbetxSimulink的功能块。

Dependency

To display and enable this parameter, select函数调用来自触发类型列表,并选择当作一个Simulin万博1manbetxk的功能复选框。

程序中使用

块参数:FunctionName
类型:特征向量
价值观:'F'|''
默认:'F'

Control activating the variant control (condition) defined with the控制变异参数。

子系统的停用变形控制。

Activate variant control of subsystem. Selecting this parameter:

  • 启用Variant control参数。

  • 显示变体徽章上指示变体的条件块的面被启用。

Dependency

To display and enable this parameter, select函数调用来自触发类型列表,并选择当作一个Simulin万博1manbetxk的功能勾选..

程序中使用

块参数:Variant
类型:特征向量
价值观:“关”|'上'
默认:“关”

指定变体控制(条件)的表达,其执行一个变型万博1manbetxSimulink的功能方框当表达式求true

(继承)

对于变异控制默认值。继承了对应所述变体的条件Function Caller块模型。什么时候控制变异is set as(继承)the value for生成预处理条件is inherited automatically from theFunction Caller块在模型中。

逻辑表达式

逻辑(布尔)表达或万博1manbetxSimulink.Variant对象表示的逻辑表达式。

该Function is activated when the expression evaluates totrue

如果你想为你的模型生成代码,在表达式定义变量万博1manbetxSimulink.Parameter对象。

Dependency

To display and enable this parameter, select函数调用来自触发类型list, select the当作一个Simulin万博1manbetxk的功能check box and then select the启用变种条件复选框。

程序中使用

块参数:VariantControl
类型:特征向量
价值观:'(继承)'|<逻辑表达式>|万博1manbetxSimulink.Variantobject
默认:'(继承)'

控制范围内的C预处理器的条件语句封闭变型的选择。

Do not enclose variant choices within C preprocessor conditional statements.

当用于ERT目标,内C预处理条件语句(的#if)围变体的选择生成代码。

Dependency

要显示并启用此参数,请选择启用变种条件复选框。

程序中使用

块参数:GeneratePreprocessorConditionals
类型:特征向量
价值观:“关”|'上'
默认:“关”

选择scope of万博1manbetxSimulink的功能block within subsystem or model.

scoped

Limit accessibility of function to:

  • Hierarchic level containing the万博1manbetxSimulink的功能block and levels below.

  • 一个层级以上资质。

全球

Function accessible from any part of the model hierarchy.

Dependency

To display and enable this parameter, select函数调用来自触发类型列表,然后选择当作一个Simulin万博1manbetxk的功能勾选..

程序中使用

块参数:FunctionVisibility
类型:特征向量
价值观:“作用域”|'全球'
默认:“作用域”

选择如何设置块的状态值时,子系统或模型被禁用。

保持

在它们的当前值保留块的状态。

重启

重置块的状态值。

继承

使用保持or重启从启动函数调用父子系统设置。如果引发剂的父是模型根,继承的设定是保持。如果触发了多个启动,将所有引发剂的家长要么保持or重启

依赖

要启用此参数,请函数调用来自触发类型list.

此参数设定只适用于该模型明确地启用和禁用的函数调用子系统。例如:

  • 函数调用子系统驻留在启用的子系统。在这种情况下,该模型能够与父子系统一起禁用函数调用子系统。

  • 函数调用引发剂,其控制函数调用子系统驻留在支持子系统。在这种情况下,该模型使得能够并用含有所述功能呼叫发起者启用子系统沿禁用函数调用子系统。

  • 函数调用引发剂是绑定到特定状态的状态流事件。看到Control Function-Call Subsystems by Using bind Actions(Stateflow的)。

  • 该函数调用initiator is an S-function that explicitly enables and disables the function-call subsystem. SeessEnableSystemWithTid的一个例子。

程序中使用

块参数:StatesWhenEnabling
类型:特征向量
价值观:'保持'|'重启'|'继承'
默认:'保持'

选择当传播可变大小的信号。

在执行过程中

传播的可变大小的信号在每个时间步。

只有当启用

Propagate variable-size signals when executing a子系统块或模型块含有启用port,Triggerport with触发类型设置功能 - 通话, 要么港口行动块。当您选择此选项,采样时间必须是周期性的。

依赖

显示和启用此参数用于Trigger端口块,选择函数调用来自触发类型list.

程序中使用

块参数:PropagateVarSize
类型:特征向量
价值观:'During execution'|“只有当启用”
默认:'During execution'

用于将信号识别触发信号或函数调用事件信号的输出端口的控制显示。

取出输出端口。

Display the output port and determine which signal caused the trigger signal or function-call event. The width of the output port signal is the width of the control signal. The signal value is:

  • 1为导致上升触发的信号

  • -1为导致下降触发的信号

  • 2一个函数调用事件

  • 0在所有其他情况

程序中使用

块参数:ShowOutputPort
类型:特征向量
价值观:“关”|'上'
默认:“关”

选择output port data type for the signal that identifies the trigger signal or function-call event signal.

auto

数据类型是一样的连接到所述输出端口。

双重价值。

int8

整数值

Dependency

要启用此参数,请选择显示输出端口复选框。

Trigger块忽略数据类型覆盖设置定点工具。

程序中使用

块参数OutputDataType
类型:特征向量
'汽车'|'double'|'INT8'
Default'汽车'

选择一个子系统或模型呼叫率。

触发

适用于不具有周期性的函数调用频率的应用。甲函数呼叫发起者可以执行一个触发(非周期性)函数调用子系统的一个或每时间步多次,并且可以提供一系列非周期性函数调用事件。

定期

A function-call initiator can execute a periodic function-call system only once per time step and must provide a series of periodic function-call events.. A Stateflow chart is an example of a function-call initiator.

Dependency

要启用此参数,请函数调用来自触发类型list.

程序中使用

块参数SampleTimeType
类型:特征向量
'triggered'|“周期性”
Default'triggered'

Specify the time interval between function calls to a subsystem or model containing thisTrigger端口块。如果间隔此参数指定,Simulink中实际呼叫率为子系统或模型不同于时间万博1manbetx®显示错误。

-1

Inherit time interval from the control signal.

TS

标量,其中T s是时间间隔。

[TS,为了]

向量,其中T s是所述时间间隔和To是初始时间偏移。

依赖

要启用此参数,请函数调用来自触发类型列表定期来自采样时间typelist.

程序中使用

块参数采样时间
类型:特征向量
'-1'|'TS'|'[Ts时,为了]'
Default'-1'

Control .

检测过零点。

不检测过零点。

依赖

要启用此参数,请risingFalling, 要么来自触发类型list.

程序中使用

块参数:ZeroCross
类型:特征向量
价值观:'上'|“关”
默认:'上'

选择触发控制信号的初始状态。

兼容性(在第一评价无触发)

没有触发的触发信号的第一评价。如果您选择此选项和Trigger块是一个子系统,其中状态是复位时,块不复位。

零。有助于评估在第一时间步骤中的上升沿或下降沿触发信号。

positive

正值。有助于评估在第一时间步长下降触发信号。

负值。有助于评估在第一时间步上升触发信号。

Dependency

要显示并激活此参数,请risingFalling, 要么来自触发类型list.

程序中使用

块参数InitialTriggerSignalState
类型:特征向量
“相容性(没有关于第一评估触发)”|'零'|'positive'|'负'
Default“相容性(没有关于第一评估触发)”

Signal Attribute

指定尺寸用于在外部附接一个触发信号模型块并传递给块的内部。

1

标量信号。

[n]的

宽度的矢量信号ñ

[M n]的

Matrix signal havingñcolumns.

Dependency

显示和启用此参数用于Triggerport block at the root-level of a model, selectrisingFalling, 要么来自触发类型list.

程序中使用

块参数PortDimensions
类型:特征向量
'1'|'[n]的'|'[m n]'
Default'1'

指定用于块驱动触发信号块的方法执行之间的时间间隔。

-1

继承的时间间隔。

TS

标量,其中T s是时间间隔。

[TS,为了]

向量,其中T s是所述时间间隔和To是初始时间偏移。

Dependency

显示和启用此参数用于Triggerport block at the root-level of a model, selectrisingFalling, 要么来自触发类型list.

程序中使用

块参数TriggerSignalSampleTime
类型:特征向量
'-1'|'TS'|'[Ts时,为了]'
Default'-1'

用于外部连接到所述触发信号指定最小值模型块并传递给块的内部。

Simulink uses this value to perform:

[]

未指定的最小值。

实标

真正的标量值。

Dependency

显示和启用此参数用于Triggerport block at the root-level of a model, selectrisingFalling, 要么来自触发类型list.

程序中使用

块参数OutMin
类型:特征向量
'[]'|“<实数标量>”
Default'[]'

用于外部连接到所述触发信号指定最大值模型块并传递给块的内部。

Simulink uses this value to perform:

[]

未指定的最大值。

实标

真正的标量值。

Dependency

显示和启用此参数用于Triggerport block at the root-level of a model, selectrisingFalling, 要么来自触发类型list.

程序中使用

块参数OutMax
类型:特征向量
'[]'|“<实数标量>”
Default'[]'

选择data type for the trigger signal attached externally to a模型块并传递给块的内部。

双精度浮点运算。

Single-precision floating point.

int8

符号的8位整数。

UINT8

无符号的8位整数。

INT16

Signed 16-bit integer.

UINT16

16位无符号整数。

INT32

符号的32位整数。

UINT32

无符号的32位整数。

Int64的

符号的64位整数。

UINT64

无符号的64位整数。

布尔

用一个布尔值trueor

fixdt(1,16)

二进制点符号的16位定点数不确定的。

fixdt(1,16,0)

用二进制点设定为零符号的16位定点数。

fixdt(1,16,2 ^,0)

Signed 16-bit fixed point number with slope set to2 ^ 0and bias set to0

<数据类型表达式>

数据类型的对象,例如万博1manbetxSimulink.NumericType。不要指定一个总线对象的表达。

Dependency

显示和启用此参数用于Triggerport block at the root-level of a model, selectrisingFalling, 要么来自触发类型list.

程序中使用

块参数OutDataTypeStr
类型:特征向量
'double'|'单'|'INT8'|'uint8'|'INT16'|'UINT16'|'INT32'|'UINT32'|'int64'|'UINT64'|“布尔”|'fixdt(1,16)'|'fixdt(1,16,0)'|'fixdt(1,16,2 ^ 0,0)'|“<数据类型表达>”
Default'double'

选择数据类型类别,显示下拉列表来帮助你定义的数据类型。

内置

数据类型显示下拉列表和数据类型覆盖

固定点

显示下拉列表符号类型缩放,and数据类型覆盖

Expression

显示文本框用于输入的表达式。

Dependency

要启用此参数,选择显示数据类型助手按钮

程序中使用

无等效命令行参数。

控制如何丢失的工作区数据,估计当从MATLAB加载数据®工作区。

在针对不存在对应的工作区数据的时间步线性插入的输出。

在时间步骤不插值输出。电流输出等于在为其数据存在的最近时间步长的输出。

Dependency

显示和启用此参数用于Triggerport block at the root-level of a model, selectrisingFalling, 要么来自触发类型list.

程序中使用

块参数
类型:特征向量
'上'|“关”
Default'上'

模型的例子

块特性

数据类型

布尔||枚举|Fixed point|integer|

Direct Feedthrough

ño

多维信号

可变大小信号

ño

过零检测

扩展功能

C / C ++代码生成
生成使用的Simulink编码器™C和C ++代码。万博1manbetx

PLC代码生成
Generate Structured Text code using Simulink® PLC Coder™.

定点转换
设计和模拟使用定点设计师™定点系统。

Introduced before R2006a