ABB_800xA学习笔记251:System_800xA_Control_6.0_AC_800M_Configuration42
2023-12-14 16:15阅读:
继续学习配置手册第一章功能和组件,进入第113页。
Control the Execution of Individual
Objects
控制单个对象的执行
Sometimes there is a need to execute specific sub function
blocks and/or sub control modules, with a time
interval and priority different from the task connected to the
application. Depending on the requirement, this
can be done in two ways:
1. To create a new task and connect this
task to all the following objects, read the sub-section 'Using a
Global Variable Connected to an External Variable on page
113.
2. To choose a new task for each
individual object (and for that object only), read the
sub-section 'Using a Global Variable Connected to a Parameter
on page 114.
有时需要执行特定的子功能块和/或子控制模块,其时间间隔和优先级与连接到应用程序的任务不同。根据要求,可以通过两种方式完成此操作:
1. 要创建一个新任务并将此任务连接到以下所有对
象,请阅读第 113 页的“使用连接到外部变量的全局变量”小节。
2. 要为每个单独的对象(并且仅针对该对象)选择新任务,请阅读第 114
页的“使用连接到参数的全局变量”小节。
Using a Global Variable Connected to an External
Variable
使用连接到外部变量的全局变量
Assume that the user has added a new task, for example SuperFast,
to the other tasks in the Project Explorer.
假设用户已将新任务(例如 SuperFast)添加到 项目资源管理器中的其他任务中。
Steps to use global variable:
使用全局变量的步骤:
1.
Declare a global variable (for example Speed) of data
type string, with the attribute constant and the initial value
'SuperFast'.
声明数据类型为字符串的全局变量(例如 Speed),其属性为常量,初始值为“SuperFast”。
2.
To reach objects that have been created in the
application, start by declaring an external variable in the type
(open the type editor and select the external variable tab).
若要访问已在应用程序中创建的对象,请首先在类型中声明外部变量(打开类型编辑器并选择外部变量选项卡)。
3.
Declare an external variable with the same name, data
type and attribute as the global variable. In this example, an
external variable called Speed of data type string and with the
attribute constant is used.
声明一个外部变量,其名称、数据类型和属性与全局变量相同。在此示例中,使用了一个名为 Speed 的外部变量,该变量的数据类型为
string 且具有属性常量。
Finally, connect the new task SuperFast to the object by
right-clicking the object
and selecting Task
connection. Type the variable name Speed in the task field. All
the following objects that are created will
have this task connection, that is,
SuperFast.
最后,通过右键单击对象并选择“任务连接”,将新任务 SuperFast 连接到该对象。在任务字段中键入变量名称
Speed。创建的以下所有对象都将具有此任务连接,即 SuperFast。
The advantages with this method of using a global variable
connected to an external variable (declared in the
type) is that every following object will be connected to the
same task (SuperFast). If the user later on
need to change the task connection for all the
objects (perhaps hundreds of objects), change only the initial
value for the global variable in the
application (see Figure 33). The present task connection for all
objects will point, via the external variable
to the task declared by the global
variable.
使用连接到外部变量(在类型中声明)的全局变量的这种方法的优点是,每个后续对象都将连接到同一任务
(SuperFast)。如果用户以后需要更改所有对象(可能是数百个对象)的任务连接,则仅更改应用程序中全局变量的初始值(参见图
33)。所有对象的当前任务连接将通过外部变量指向全局变量声明的任务。
Figure 33. All objects will have the same task connected
(SuperFast), once the first object has connected Speed.
图 33.
一旦第一个对象连接了速度,所有对象都将连接相同的任务 (SuperFast)。