主要内容

Requirements Table

Formally model requirements with input conditions

  • 库:
  • Requirements Toolbox

  • Requirements Table block icon.

描述

TheRequirements Tableblock models formal requirements. The block starts with evaluating conditions listed in the前提标签。如果满足条件,您可以检查其他模拟数据是否符合指定条件后条件column, or execute desired actions, such as block outputs or functions, in the行动column. For more information, see用一个Requirements Table Block to Create Formal Requirements

您还可以通过定义模型的物理限制来限制要求Assumptions标签。看Add Assumptions to Requirements

您只有在有需求Toolbox™

端口

输入

展开全部

输入端口,指定为标量,向量或矩阵。您定义的每个输入数据都有相应的输入端口。

依赖性

要创建输入端口,请打开块并在符号窗格。看在需求表中定义数据

数据类型:单身的|双倍的|int8|INT16|INT32|INT64|UINT8|UINT16|UINT32|Uint64|布尔|固定点|枚举|公共汽车

Output

展开全部

Output port, specified as a scalar, vector, or matrix. Each output data that you define has a corresponding output port.

依赖性

要创建输出端口,请打开块并在符号窗格。看在需求表中定义数据

数据类型:单身的|双倍的|int8|INT16|INT32|INT64|UINT8|UINT16|UINT32|Uint64|布尔|固定点|枚举|公共汽车

Parameters

展开全部

主要的

选择如何在Requirements Tableblock icon.

  • 没有任何- 请勿显示端口标签。

  • 港口- 显示输入和输出数据的名称。

  • FromPortBlockName- 显示输入和输出数据的名称。

  • 信号名称- 如果命名连接到端口的信号,请显示信号名称。否则,显示数据的名称。

Programmatic Use

Parameter:ShowPortLabels
类型:字符串标量或字符向量
价值:"none"|“港口”|“ fromportblockname”|“信号名称”
Default:“港口”

Control user access to the contents of theRequirements Tableblock.

  • ReadWrite- 启用打开和修改Requirements Tableblock contents.

  • 只读- 启用开放Requirements Tableblock.

  • NoReadOrWrite– Disable opening or modifying of theRequirements Tableblock.

Note

当您尝试查看一个内容时Requirements Tableblock whose读/写许可parameter isNoReadOrWrite,块没有响应。例如,双击Requirements Tableblock, Simulink®不打开表内容,也不显示消息。

Programmatic Use

Parameter:权限
类型:字符串标量或字符向量
价值:"ReadWrite"|“只读”|“ Noreadorwrite”
Default:"ReadWrite"

尝试消除模拟过程中包含原子单元的人工代数循环。

  • off- 不要试图消除包括原子单元在内的人工代数环。

  • - 尝试消除包括原子单元在内的人工代数环。

Programmatic Use

Parameter:微量浮游
类型:字符串标量或字符向量
价值:"off"|“上”
Default:"off"

指定如何安排Requirements Tableblock.

  • 采样时间- 指定是否在Requirements Tableblock must run at the same rate or can run at different rates.

  • Periodic Partition- 安排Requirements Table带有定期分区的块条目。指定分区名称和与分区运行速率相对应的示例时间。

  • Aperiodic Partition- 安排Requirements Tableblock entries with an aperiodic partition. Specify a partition name.

Programmatic Use

Parameter:ScheduleAs
类型:字符串标量或字符向量
价值:"SampleTime"|“离散部门”|"UnconstrainedPartition"
Default:"SampleTime"

指定该块中的条目是必须以相同的速率运行还是可以以不同的速率运行。

  • 如果条目在Requirements Tableblock can run at different rates, specify the sample time as inherited (-1).

  • If entries must run at the same rate, specify the sample time,TS, corresponding to this rate.

Programmatic Use

Parameter:SystemSampleTime
类型:字符串标量或字符向量
价值:“ -1”|“ [TS 0]”
Default:“ -1”

Code Generation

要启用这些参数,您必须有万博1manbetxSimulink Coder™或者Embedded Coder®

选择该块用于生成原子(非虚拟)单元代码的代码格式。

  • 汽车万博1manbetxSimulink编码器和Embedded Coder choose the optimal code format based on the type and number of instances of theRequirements Tableblock in the model.

  • Inline万博1manbetxSimulink编码器并嵌入编码器内联Requirements Tableblock unconditionally.

  • 不可修复的功能万博1manbetxSimulink编码器显式地在单独的文件中生成单独的函数。

  • Reusable function万博1manbetxSimulink编码器嵌入式编码器生成一个具有参数的函数,该函数允许在模型包含块的多个实例时重复使用块代码。

    此选项还生成了一个具有参数的函数,该函数允许Requirements Table要在模型参考层次结构的生成代码中重复使用的块,该代码包括一个Requirements Tableblock across referenced models. In this case, the block must be in a library.

提示

  • 什么时候you want to represent multiple instances of aRequirements Table屏蔽是一个可重复使用的功能,您可以将每个实例指定为汽车或ASReusable function。最好使用一个或另一个,因为两者都使用两个可重复使用的功能,一个用于每个名称。这些选择的结果仅在不可能的情况下有所不同。选择汽车不允许控制功能或文件名Requirements Table块代码。

  • TheReusable function汽车选项都尝试确定多个实例是否Requirements Table存在块,如果可以重复使用代码。仅在无法重复使用时,选项有所不同:

    • 汽车yields inlined code, or if circumstances prohibit inlining, the setting separates functions for eachRequirements Tableblock instance.

    • Reusable function每个功能都有一个单独的功能Requirements Tableblock instance in the model.

  • 如果您选择Reusable functionwhile your generated code is under source control, set文件名选项Use subsystem name,使用功能名称, 或者User specified。否则,当您修改模型时,代码文件的名称会更改,从而阻止了文件上的源控制。

Programmatic Use

Parameter:RTWSystemCode
类型:字符串标量或字符向量
价值:"Auto"|"Inline"|“不可恢复的功能”|“可重复使用的功能”
Default:"Auto"

选择如何万博1manbetxSimulink编码器名称其为块生成的函数。

如果您嵌入了编码器,则可以控制功能名称,并具有配置参数上的选项Code Generation>Identifiers窗格。

  • 汽车- 使用默认命名约定分配一个唯一的函数名称,model_block(), 在哪里model是模型的名称,block是块的名称(或重复使用代码时相同的块的名称)。

  • Use subsystem name- 使用Requirements Table块名称为函数名称。默认情况下,函数名称使用命名约定model_block

    Note

    当一个Requirements Table块在库中,功能包装参数设置为Reusable function, if you set theUse subsystem name选项,代码生成器使用库块的名称作为函数名称和文件名。

  • User specified– Enable the功能名称场地。输入法律C或C ++函数名称,必须是唯一的。

有关更多信息,请参阅生成子系统代码作为单独的函数和文件(万博1manbetxSimulink编码器)

依赖性

To enable this parameter, set功能包装不可修复的功能或者Reusable function

Programmatic Use

Parameter:RTWFcnNameOpts
类型:字符串标量或字符向量
价值:"Auto"|“使用子系统名称”|"User specified"
Default:"Auto"

Name of the function for the block code.

如果要给该函数一个特定名称而不是使用自动化名称或块名称,请使用此参数。有关更多信息,请参阅生成子系统代码作为单独的函数和文件(万博1manbetxSimulink编码器)

依赖性

To enable this parameter, set the功能名称选项参数为User specified

Programmatic Use

Parameter:RTWFcnName
类型:字符串标量或字符向量
价值:""|“ <功能名称>”
Default:""

How万博1manbetxSimulink编码器为其为块生成的函数的单独文件命名。

  • 汽车– Depending on the configuration of the block and how many instances are in the model,汽车产生不同的结果:

    • If the code generator does不是generate a separate file for the block, the block code is generated within the code module generated from the block parent system. If the block parent is the model itself, the block code is generated withinmodel。C或者model.cpp

    • 如果您选择Reusable function为了功能包装parameter and your generated code is under source control, consider specifying a文件名选项除了汽车。这样可以防止生成的文件名由于无关的模型修改而导致更改,这对于使用源控制来管理配置而言是有问题的。

    • 如果您选择Reusable function为了功能包装parameter and there are multiple instances of the block in a model reference hierarchy, in order to generate reusable code for the block,文件名选项必须设置为汽车

  • Use subsystem name- 代码生成器使用块名作为文件名生成一个单独的文件。

    Note

    什么时候文件名选项被设定为Use subsystem name,如果模型包含模型blocks, or if a model reference target is being generated for the model. In these situations, the file name for theRequirements Tableblock consists of the block name prefixed by the model name.

  • 使用功能名称– The code generator uses the function name specified by功能名称选项作为文件名。

  • User specified- 此选项启用File name (no extension)text entry field. The code generator uses the name you enter as the file name. Enter a file name, but do not include the。C或者.cpp(或另一个)扩展。此文件名不必是唯一的。

    Note

    同时Requirements Tableblock source file name need not be unique, you must avoid giving nonunique names that result in cyclic dependencies (for example,sys_a.hincludessys_b.h,sys_b.hincludessys_c.h, andsys_c.hincludessys_a.h).

依赖性

To enable this parameter, set功能包装不可修复的功能或者Reusable function

Programmatic Use

Parameter:rtwfilenameopts
类型:字符串标量或字符向量
价值:"Auto"|“使用子系统名称”|“使用功能名称”|"User specified"
Default:"Auto"

生成文件的名称。您指定的文件名不一定是唯一的。但是,避免给出导致循环依赖性的非唯一名称(例如,sys_a.hincludessys_b.h,sys_b.hincludessys_c.h, andsys_c.hincludessys_a.h).

有关更多信息,请参阅生成子系统代码作为单独的函数和文件(万博1manbetxSimulink编码器)

依赖性

To enable this parameter, set文件名选项User specified

Programmatic Use

Parameter:RTWFILENAME
类型:字符串标量或字符向量
价值:""|“ <文件名>”
Default:""

扩展功能

版本History

Introduced in R2022a