ABB_800xA学习笔记247:System_800xA_Control_6.0_AC_800M_Configuration37
标签:
abbsystem_800xa_ac800m配置手册功能和组件 |
分类: ABBDCS |
继续学习配置手册第一章功能和组件,进入第66页。
External Variables
外部变量
External variables are not really
variables, in the sense that they carry a
value. Instead,
external variables work like parameters, that is, they point to a
variable value (in this case a global variable). In
order for an object to reach a global
variable (located at the top of the application) it must
use a pointer, or more specifically,
an external
variable. By declaring an external variable inside an object, it is
possible to access global variables efficiently from a deep
code design, without having to
pass variable values through
parameters.
外部变量不是真实变量,因为它们带有一个数值。相反,外部变量的工作方式与参数类似,也就是说,它们指向变量值(在本例中为全局变量)。为了使对象能够访问全局变量(位于应用程序的顶部),它必须使用指针,或者更具体地说,使用外部变量。通过在对象内部声明外部变量,可以从深度代码设计中有效地访问全局变量,而无需通过参数传递变量值。
Figure 29. The variable z can be
accessed deep down in the structure, using several parameters.
(Bottom): Using external (and global) variables, the variable z is
accessed directly, without having to use parameters.
图 29. 图 29.变量 z
可以在结构的深处使用几个参数进行访问。(下):使用外部(和全局)变量,可以直接访问变量 z,而无需使用参数。
Access Variables
访问变量
Access variables are needed when the
system works as a server. Allowed
protocols are MMS,
COMLI, MODBUS TCP and SattBus. MMS and SattBus variables
are declared in the Access Variable Editor under
the corresponding tab, COMLI
and MODBUS
TCP variables under the Address tab. The variable name must be
unique within the physical control
system.
当系统作为服务器工作时,需要访问变量。允许的协议包括 MMS、COMLI、MODBUS TCP
和 SattBus。MMS 和 SattBus 变量在 Access 变量编辑器的相应选项卡下声明,COMLI 和 MODBUS
TCP 变量在 Address 选项卡下声明。变量名称在物理控制系统中必须是唯一的。
Open the Access Variable Editor by right-clicking the ‘Access
Variables’ icon under the respective Controller and select
Editor.
右键单击相应控制器下的“访问变量”图标,打开访问变量编辑器,然后选择编辑器。
To limit the access to a variable, set the attribute to
ReadOnly. If the attribute is left blank, it is possible to both
read and write.
若要限制对变量的访问,请将该属性设置为 ReadOnly。如果该属性留空,则可以同时读取和写入。
Set the Attribute to 'ReadOnly' if the connected variable is
located in a SIL application. A compile error is shown if the
ReadOnly attribute is not set. And for the Address tab (that has no
attribute column) it is allowed to connect the access variable to a
SIL variable, but the variable is implicitly ReadOnly. A client
that tries to write to the access variable will get a runtime error
(or a controller shutdown if the controller is pre SV6.0).
如果连接的变量位于 SIL 应用程序中,则将属性设置为“ReadOnly”。如果未设置 ReadOnly
属性,则会显示编译错误。对于“地址”选项卡(没有属性列),允许将访问变量连接到 SIL 变量,但该变量是隐式
ReadOnly。尝试写入访问变量的客户端将收到运行时错误(如果控制器是 SV6.0 之前的版本,则控制器关闭)。
MMS
MMS variables can only be accessed by name.
MMS变量只能通过名字访问。
An MMS access variable name can be up to 32 characters long
and contain letters, digits and the characters dollar($) and
underscore(_). However, an access
variable name cannot begin with a digit or the dollar
($) character.
MMS访问变量名称最多可包含 32
个字符,包含字母、数字以及字符 dollar($) 和 underscore(_)。但是,访问变量名称不能以数字或美元 ($)
字符开头。
All data types for single and structured variables are
allowed, with the exception of ArrayObject and QueueObject.
允许单个变量和结构化变量的所有数据类型,但
ArrayObject 和 QueueObject 除外。
To limit the access to an MMS variable, set the Attribute to
ReadOnly. If the attribute is left blank, both read and write is
possible.
为限制对MMS变量的访问,设置Attribute为ReadOnly,如果Attribute空白,可以读写。
SattBus
SattBus variables can be
accessed in three ways:
有三种方式访问SattBus 变量
- Standard SattBus name such as Valve:
标准SattBus 名字,例如Valve
- the name must consist of exactly five ASCII characters, but
may not begin with a percentage sign
(%). 名称必须正好由五个
ASCII 字符组成,但不能以百分号 (%) 开头。
- COMLI direct addressing (see
Address ),
COMLI 直接寻址(参见地址)、 - IEC 61131-3 standard representation for
variables
IEC 61131-3 变量标准表示
必须在 COMLI 选项卡下输入 IEC61131-3 地址
Allowed data types for a single variable are, bool, dint, int,
uint, real or string. Whereas a structured variable does not allow
string data type.
单个变量允许的数据类型为
bool、dint、int、uint、real 或 string。而结构化变量不允许字符串数据类型。
Address
地址
Address variables can be accessed in two ways only,
either direct addressing with capital X and the number for boolean, or
capital R and the number for registers (R0-R65535 for PA controller and 65000 for HI
controller) beginning with a
percentage sign or not, or according to IEC 61131-3
standard representation for variables.
地址变量只能通过两种方式访问,要么使用大写字母 X
和布尔数字直接寻址,要么使用大写字母 R 和寄存器编号(R0-R65535 用于 PA 控制器,65000 用于 HI
控制器)以百分比符号开头,或者根据 IEC 61131-3 变量标准表示。
Allowed data types for a single variable are bool, dint, int,
or uint, whereas structured variables must all be of same data
type. A structured variable is
allowed to
contain more than 512 booleans and contain more than 32 components
of integer data type. Overlapping areas are not
allowed.
单个变量允许的数据类型为 bool、dint、int 或
uint,而结构化变量必须全部为相同的数据类型。一个结构化变量允许包含超过 512 个布尔值,并包含超过 32
个整数数据类型的分量。不允许重叠区域。
Example
例子
An access variable name "X0" is defined and connected
to a variable which contains 544 Boolean components at octal address 0-1037.
The next available address is
then 1040
to ensure that areas do not overlap.
定义了一个访问变量名称“X0”,并连接到一个变量,该变量包含八进制地址 0-1037 的
544 个布尔分量。下一个可用地址是 1040,以确保区域不重叠。
At least one of the variables in the access variable table has
to be defined. For missing variables, requested data of boolean
data type will be returned with
the value
False and requested data of integer data type will be returned with
the value "0". Writing to undefined variables is
ignored.
必须定义访问变量表中的至少一个变量。对于缺失的变量,将返回值为 False
的布尔数据类型的请求数据,返回值为“0”的整数数据类型的请求数据。写入未定义的变量将被忽略。

加载中…