模型_step
生成的C/C ++入口点函数包含每个步骤的执行代码金宝app模型
Description
is an execution function that contains the output and update code for the blocks in a Simulink®模型。void
模型_step(void
)
是具有任务标识符的执行函数,该函数包含Simulink模型中块的输出代码和更新代码。金宝appvoid
model_step_n(void
)
步骤入口点函数计算块的当前值。如果启用了记录,则步骤功能会更新记录变量。根据设计,从中断级别调用步骤函数rt_OneStep
((invoked as a timer ISR). Thert_OneStep
function calls the模型_step
function to execute processing for one clock period of the model. For a more information, seeRT_ONESTEP和调度注意事项(嵌入式编码器)。
如果模型具有有限的停止时间,则步骤函数在当前时间等于停止时间时表示执行结束。否则,如果这些条件中的一个或多个是正确的,则步骤函数不会检查当前时间,并且程序无限期运行:
The model stop time is set to
inf
。日志记录是禁用的。
范围需要终止功能is not selected.
模型的步骤入口点函数的生成的调用接口取决于以下参数:
To generate a step entry-point function, select theSingle output/update function范围。If you clear this parameter,
model_output
and模型_update
入口点功能是生成步骤函数的。要生成具有可配置参数的单个步骤函数,请清除将每个离散率视为单独的任务范围。要根据时序要求生成单独的步骤函数,请选择此参数。有关更多信息,请参阅将每个离散率视为单独的任务。
参数值:
Off
(单率或多级单任务模型)Function Prototype:
void model_step(void);
参数值:
On
((multirate multi-tasking model)Function Prototype:
void model_step_n(void);
((n
是任务标识符)
要更改生成的调用接口,请设置语and代码接口包装参数。有关更多信息,请参阅代码接口包装。
To preview and customize the name and arguments of the generated C or C++ step entry-point function an Embedded Coder®license is required. To preview a step entry-point function, open the Code Mappings editor and click the功能标签。自定义函数名称,在Function Name列单击并直接编辑电子表格。自定义函数名称和参数,在功能预览列单击功能超链接,然后从打开的对话框中配置步骤函数。使用模板自定义函数,功能自定义模板column select a template to apply to the function. For more information, seeConfigure Name and Arguments for Individual Step Functions(嵌入式编码器),,,,交互式配置C ++接口(嵌入式编码器),,,,and为函数配置默认代码生成(嵌入式编码器)。
To view the generated step entry-point function, open the代码查看或代码生成报告并查看模型的源代码。有关更多信息,请参见分析生成的代码接口(嵌入式编码器)。
Examples
输入参数
输出参数
版本历史记录
也可以看看
model_initialize
|model_terminate
|模型_reset
(嵌入式编码器)