IsFirstMastCycle:指示此循环是否为第一个 MAST 循环

功能描述

此功能在启动后的第一个 MAST 循环期间返回 TRUE。

图形表示形式

IL 和 ST 表示形式

若要查看 IL 或 ST 语言的一般表示形式,请参阅功能和功能块表示形式一章。

I/O 变量描述

输出

类型

注释

IsFirstMastCycle

BOOL

启动之后的第一个 MAST 任务循环期间为 TRUE。

示例

此示例介绍三个一起使用的功能 IsFirstMastCycleIsFirstMastColdCycleIsFirstMastWarmCycle

请在 MAST 任务中使用此示例。否则,可能会运行多次或一次也不运行(在第一个 MAST 任务循环期间可能会多次调用或不调用某个附加任务):

VAR
MyIsFirstMastCycle : BOOL;
MyIsFirstMastWarmCycle : BOOL;
MyIsFirstMastColdCycle : BOOL;
END_VAR
MyIsFirstMastWarmCycle := IsFirstMastWarmCycle();
MyIsFirstMastColdCycle := IsFirstMastColdCycle();
MyIsFirstMastCycle := IsFirstMastCycle();
IF (MyIsFirstMastWarmCycle) THEN
(*This is the first Mast Cycle after a Warm Start: all variables are set to their initialization values except the Retain variables*)
(*=> initialize the needed variables so that your application runs as expected in this case*)
END_IF;
IF (MyIsFirstMastColdCycle) THEN
(*This is the first Mast Cycle after a Cold Start: all variables are set to their initialization values including the Retain Variables*)
(*=> initialize the needed variables so that your application runs as expected in this case*)
END_IF;
IF (MyIsFirstMastCycle) THEN
(*This is the first Mast Cycle after a Start, i.e. after a Warm or Cold Start as well as STOP/RUN commands*)
(*=> initialize the needed variables so that your application runs as expected in this case*)
END_IF;