加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

ABB_800xA学习笔记291:System_800xA_Control_6.0_AC_800M_Configuration81

(2023-12-29 19:04:00)
标签:

abb

system_800xa_ac800m

配置手册

功能和组件

分类: ABBDCS
继续学习ABB 800xA配置手册第一章功能和组件,进入第173页。
Offset
偏移
The compiler will detect inappropriate offset settings.
编译器会检测不恰当的偏移设置。
The offset of each task must be equal or greater than the sum of the execution times of all higher-priority tasks.
每个任务的偏移量必须等于或大于所有更高优先级任务的执行时间之和。
If your tasks are scheduled to execute at the same time you will receive a warning during download. However, this compiler function is merely calculating theoretical periodic executions, which means that it will not warn you for task collision caused by, for example a too close offset time. Therefore, consider the compiler warning as a first preliminary check provided to you and not as a guarantee that will prevent task collisions.
如果计划同时执行任务,那么在下载过程中将会收到警告。但是,此编译器函数仅计算理论上的周期性执行,这意味着它不会警告您由于偏移时间过近而导致的任务冲突。因此,请将编译器警告视为提供给您的第一个初步检查,而不是防止任务冲突的保证。
Two tasks will be scheduled to start execution at the same time if the greatest common divisor of the tasks interval times divides the difference in the tasks offsets.
如果任务间隔时间的最大公约数除以任务偏移量的差值,则将安排两个任务同时开始执行。
Turning off Task Collision warnings
关闭任务冲突警告
You can turn off the task collision warning from the Project Explorer.
您可以从 Project Explorer 中关闭任务冲突警告。
1. Right-click the Project item and select Settings > Compilation Warnings from the context menu. A Compilation warnings dialog box will open.
右键点击项目,从上下文菜单选择设置 > 编译警告,打开编译警告对话框。
2. Click to clear Task Collisions check box and then OK.
点击清楚热巴舞冲突复选框,点击OK按钮
When tasks are scheduled to execute at the same time, the task with the highest priority will be executed first. If tasks have the same priority the task with the shortest interval time will be executed first. Offset is a mechanism that can be used to avoid unexpected delays in execution when tasks are scheduled to execute at the same time.
当任务计划同时执行,有最高优先级的先执行。如果任务有相同的优先级,则先执行间隔时间最短的任务。偏移量是一种机制,可用于避免在计划任务同时执行时执行时出现意外的执行延迟。
Do not change task offset for a controller with a running application. This may result in that the task executes one more time than expected.
不要修改正在运行应用程序的任务的偏移量。这可能导致任务执行的次数比预期多一次。
In Figure 70 and Figure 71, the execution of two tasks with the same priority with interval times of 50 ms and 100 ms is shown. When both tasks have a 0 ms offset (Figure 70), the execution start time of task 2 is delayed, and the actual interval time for task 2 is influenced by variations in the execution time of task 1.
在图70和图71,有相同优先级,间隔时间为50ms和100ms的两个任务的执行。当两个任务的偏移量均为 0 ms 时(图70),任务2 的执行开始时间会延迟,并且任务2 的实际间隔时间会受到任务1 执行时间变化的影响。
ABB_800xA学习笔记291:System_800xA_Control_6.0_AC_800M_Configuration81
Figure 70. No offset. The two tasks have the same priority, but different interval times (50 and 100 ms).
图70. 没有偏移,两个任务有相同优先级,不同间隔时间(50和100ms)
If task 2 is assigned an offset, as in Figure 71, neither task is delayed, and the actual interval time for task 2 will not be affected by task 1.
如果任务2分配偏移量,如图71,如果为任务2分配了一个偏移量,则两个任务都不会延迟,并且任务2的实际间隔时间不会受到任务1的影响。
ABB_800xA学习笔记291:System_800xA_Control_6.0_AC_800M_Configuration81
Figure 71. Offset is set on task 2. The two tasks have the same priority, but different interval times (50 and 100 ms) and are thus executed at the requested times.
图71. 设置任务2偏移量。两个任务有相同优先级,不同间隔时间(50和100ms),因此在请求的时间执行。
An application starts to execute by scheduling all tasks in the application to execute at the same time. The task with highest priority is executed first, and if tasks have the same priority, the task with the shortest interval time will be executed first.
应用程序通过计划应用程序中的所有任务同时执行来开始执行。优先级最高的任务优先执行,如果任务的优先级相同,则间隔时间最短的任务将优先执行。
Execution Synchronization
执行同步
When a task has finished execution of the first scan after application start at time t, the start of its next execution is synchronized to time 0 (the time the controller started to execute).
当任务在时间 t 启动应用程序后完成第一次扫描的执行时,其下一次执行的开始将同步到时间 0(控制器开始执行的时间)。
t = n * (interval time) + d, 0 ≤d < interval time
t =mn*间隔时间 + d,0≤d<间隔时间
d is the time from the start of the current interval time, to when the task finished execution in the current interval. The synchronization to time zero (0) implies that the start of the next execution will be at the first start point after the current time.
d 是从当前间隔时间开始到任务在当前间隔内完成执行的时间。与时间零 (0) 的同步意味着下一次执行的开始将在当前时间之后的第一个开始点。

If offset = 0, the task will be scheduled to execute at time (n + 1) * (interval time). However, if the time to the start of the next execution, (interval time) - d, is less than 10 ms, the task will be scheduled to execute a time (n + 2) * (interval time).
如果 offset = 0,则任务将安排在时间 (n + 1) *(间隔时间)执行。但是,如果到下一次执行开始的时间(间隔时间)- d 小于 10 毫秒,则任务将被安排为执行时间 (n + 2) *(间隔时间)。
If offset > 0, then if offset > d, the start of the next execution will be at a time n * (interval time) + offset. If offset < d, the start of the next execution will be at a time (n + 1) * (interval time) + offset. If the time to the start of the next execution is less than 10 ms, the interval time will be added to the start time of the next execution.
如果偏移量> 0,则如果偏移量> d,则下一次执行的开始时间为时间 n *(间隔时间)+ 偏移量。如果偏移量< d,则下一次执行的开始时间为 (n + 1) *(间隔时间)+ 偏移量。如果距离下一次执行开始的时间小于 10 毫秒,则间隔时间将添加到下一次执行的开始时间中。

The same synchronization of execution time will be performed after a change in interval time or offset.
在间隔时间或偏移量更改后,将执行相同的执行时间同步。
Time critical task is not synchronized to time zero (0).
时间关键型任务未同步到时间零 (0)。

Communication Considerations
通信注意事项
POU execution has higher priority than other functions, such as communication. These functions are performed in the gaps between the execution of different tasks. If several tasks with long execution times are executed immediately, one after the other, the time gaps are few but long (see Figure 72).
POU 执行的优先级高于其他功能,例如通信。这些功能是在执行不同任务之间的间隙中执行的。如果立即执行多个执行时间较长的任务,则时间间隔很少,但很长(参见图 72)。
ABB_800xA学习笔记291:System_800xA_Control_6.0_AC_800M_Configuration81
Figure 72. The result of having no offset for three tasks with long execution times. The gap (Ta+Tb) is the time available for the execution of other functions, for example communication.
图 72.执行时间较长的三个任务没有偏移量的结果。间隙 (Ta+Tb) 是可用于执行其他功能(例如通信)的时间。
The offset mechanism can be used to make the time gaps more frequent (see Figure 73).
偏移机制可用于使时间间隔更频繁(见图73)。
ABB_800xA学习笔记291:System_800xA_Control_6.0_AC_800M_Configuration81
Figure 73. The result of assigning offset to tasks 2 and 3, is that the time available for the execution of other functions occurs more often (Ta).
图 73.将偏移量分配给任务 2 和 3 的结果是,可用于执行其他功能的时间更频繁地发生 (Ta)。
The same processor handles communication and IEC 61131-3 code. This means that you have to consider how much code you include in each task, when you tune the tasks.
同一处理器处理通信和 IEC 61131-3代码。这意味着在调整任务时,您必须考虑每个任务中包含的代码量。
Assume that we have a task running code with an execution time of 500 ms and an interval time of 1000 ms. This means a cyclic load of 50% (load = execution time / interval time). But, this also means that no communication can be performed during the 500 ms execution (since communication has lower priority than the task).
假设我们有一个任务运行代码,执行时间为500毫秒,间隔时间为1000毫秒。这意味着 50% 的循环负载(负载 = 执行时间/间隔时间)。但是,这也意味着在 500 毫秒的执行期间无法执行任何通信(因为通信的优先级低于任务)。

Now, assume that we have divided the code into 4 tasks such that each one corresponds to 125 ms of the execution time. The interval time is still 1000 ms, hence the load is still 50%. But, if we set the offset for the 4 tasks to 0, 250, 500, and 750 ms, the result will be completely different. Now, code will be executed for 125 ms, after which there will be a pause when communication can be performed. Following this, code will be executed for another 125 ms followed by another pause when further communication can be performed. Hence, we still have the same cyclic load, but the possibility for communication has increased considerably.
现在,假设我们将代码分为4个任务,每个任务对应于125毫秒的执行时间。间隔时间仍为 1000 毫秒,因此负载仍为 50%。但是,如果我们将 4 个任务的偏移量设置为 0、250、500 和 750 毫秒,结果将完全不同。现在,代码将执行 125 毫秒,之后可以执行通信时会暂停。在此之后,代码将再执行 125 毫秒,然后在可以执行进一步通信时再次暂停。因此,我们仍然具有相同的循环负载,但通信的可能性已大大增加。
To conclude, try to tune your tasks using offsets before you change the priority. Actually, the only time you have to change the priority, is when two tasks have so much code that their execution cannot be “contained” within the same time slot, that is, the total execution time exceeds the length of the time slot. It is then necessary to specify which of the two tasks is most important to the system.
总而言之,在更改优先级之前,请尝试使用偏移量来调整任务。实际上,唯一需要更改优先级的情况是当两个任务的代码太多,以至于它们的执行无法“包含”在同一时隙内时,即总执行时间超过了时隙的长度。然后,有必要指定两个任务中的哪一个对系统最重要。

More information about task tuning can be found in the System 800xA Control AC 800M Planning (3BSE043732*).
有关任务调优的更多信息,请参见 System 800xA Control AC 800M Planning (3BSE043732*)。


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有