ABB_800xA学习笔记245:System_800xA_Control_6.0_AC_800M_Configuration35
2023-12-12 08:00阅读:
继续学习配置手册第一章功能和组件,进入第93页。
The following example tries to illustrate how a variable will be
handled, depending
on different attribute settings.
Suppose the variable valveC has the attribute
coldretain, valveR has the attribute retain and
valve has no attribute. Also, suppose that
these three variables have the initial value = True (see Figure 28
for the variable declaration).
下面的示例尝试说明如何处理变量,具体取决于不同的属性设置。假设变量 valveC 具有 coldretain 属性,valveR 具有
retain 属性,而 valve 没有属性。此外,假设这三个变量的初始值 = True(有关变量声明,请参见图28)。
Figure 28. Three variables with different attributes setti
ngs
图28. 三个设置不同属性的变量
According to the attribute settings in Figure 28, the variables
will be read or written on different occasions in the
given code example below, (read the comments under
each IF statement):
一句图28设置的属性,变量在不同情况下进行读写(阅读每个if语句下面的注释)。
IF valveC THEN
(*Code in this position is only executed once after the very
first cold restart*)
valveC := false;
END_IF
IF valveR THEN
(*Code in this position is only executed once after a cold
restart*)
valveR := false;
END_IF
IF valve THEN
(*Code in this position is only executed once after a cold
restart
and once after a warm restart*)
valve := false;
END_IF
Note that execution does not have to take place during the first
scan after restart, for example, when IF valve is
embedded in another IF statement.
请注意,在重新启动后的第一次扫描期间不必执行,例如,当 IF 阀嵌入到另一个 IF 语句中时。
Variables and parameters should have the attribute retain, unless
they are written at each scan. When a change has been
made to the application, the entire application
will be (warm) restarted and in doing so,
variables without the attribute retain will be
set to their initial values, and there is a chance that the change
will not be totally bumpless. It is recommended
that In and Out parameters to function blocks always
have the attribute retain.
变量和参数应有属性值retain,除非每一次扫描时写入它们。当对应用程序修改时,整个应用程序将热启动,在此过程中,没有保持属性的变量将设置为初始值,并且更改可能不会完全没有震荡。建议始终将功能块的In和Out参数设置retain属性。
More information is given in Control Builder online help.
Search the index for “attribute”.
Control Builder 联机帮助中提供了更多信息。在索引中搜索“attribute”。
Initial Values
初始值
It is possible to give the variable an initial value, which
will be assigned to the variable the first time the
application is executed. This setting overrides the default
data type value. Table 6 shows default initial
values for the most common data
types.
可以为变量指定一个初始值,该值将在第一次执行应用程序时分配给变量。此设置将覆盖默认数据类型值。表 6
显示了最常见数据类型的默认初始值。
Descriptions
描述
The description field describes and provides information
about the variable. A short descriptive text may
include an explanation of the cause of a condition or a simple
event, for example “Pump 1 is running”. Since
the description is not downloaded to the
controller, the size of the description is
irrelevant.
description 字段描述并提供有关变量的信息。简短的描述性文本可以包括对条件或简单事件原因的解释,例如“泵 1
正在运行”。由于描述不会下载到控制器,因此描述的大小无关紧要。