使用 OPC 标签提高性能

发布于 2024-07-04 20:06:53 字数 424 浏览 11 评论 0原文

我正在使用一个名为 Think'n'Do 的基于 PC 的自动化软件包,由 Phoenix Contact 创建,它是实时的处理、读取输入/控制逻辑/写入输出全部在最多 50ms 内完成。 我们有一个 OPC 服务器,每 10 毫秒从 PLC 读取/写入标签。 将标签写入 PLC 并读回写入值时存在较长延迟 (Think'n'Do (50ms) > OPC Server (10ms) > PLC (10ms) > OPC Server (10ms) > Think 'n'Do (50ms) )这个过程最多需要 6 秒才能完成,而根据我的计算,它应该只需要 130 毫秒。

任何关于去哪里寻找或为什么需要花费这么长时间的想法都会有所帮助。

I am working with a PC based automation software package called Think'n'Do created by Phoenix Contact It does real time processing, read inputs/ control logic / write outputs all done in a maximum of 50ms. We have an OPC server that is reading/writing tags from a PLC every 10ms. There is a long delay in writing a tag to the PLC and reading back the written value (Think'n'Do (50ms) > OPC Server (10ms) > PLC (10ms) > OPC Server (10ms) > Think'n'Do (50ms) ) that process takes up to 6 seconds to complete when it should by my math only take 130ms.

Any ideas of where to look or why it might be taking so much longer would be helpful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

日久见人心 2024-07-11 20:06:53

这里有几个地方需要注意:OPC 客户端配置、OPC 客户端本身、OPC 服务器或 PLC 本身。

您应该检查以下内容:

  1. OPC 客户端配置 - 您添加 OPC 标签的 OPC 组应该具有快速扫描速率(即 100 毫秒到 1 秒,具体取决于您的用途)。 在写入值的过程中,您是否注意到值的输入速度是否更快? 如果不是,则可能存在 DCOM 或网络配置问题。
  2. OPC 客户端 - 下载免费的 OPC 客户端软件(可能来自 OPC 基金会网站或主要 OPC 服务器软件供应商),看看是否可以更快地获取值。 如果是这样,您的客户可能有问题。
  3. OPC 服务器 - 某些 OPC 服务器具有诊断工具。 打开它们,看看写入实际发生的时间以及读取实际发生的时间。 如果您能回答这些问题,您就可以确定延迟的罪魁祸首是来自 PLC 还是 OPC 服务器。 还要观察 OPC 服务器的 CPU 使用情况,如果您发现它使用的 CPU 比正常情况多,则可能意味着 OPC 服务器负载过重,这可能会降低性能。
  4. 其他——最后检查PLC、网络是否工作正常。

Here are a few places to look: OPC Client configuration, OPC Client itself, OPC Server, or the PLC itself.

Here are things you should check:

  1. OPC Client configuration - The OPC Group you've added the OPC tags to should have a fast scan rate (ie. 100 ms to 1 sec depending on what you use it for). With the act of writing values, do you notice if the values come in faster? If not, then there might be a DCOM or network configuration issue.
  2. OPC Client - Download a free OPC Client software(probably from the OPC Foundation website or major OPC Server software vendors) to see if you get the values back faster. If so, there might be a problem with your client.
  3. OPC Server - Some OPC Server have diagnostic tools. Turn those on and see what is the time the writes actually occur and what time the reads actually take place. If you can answer those questions, you can probably identify whether the culprit of the delay is from the PLC or the OPC Server. Also observe the CPU usage of the OPC Server, if you notice it is using more CPU than normal, it probably means that the OPC Server is loaded down which might deteriorate performance.
  4. Others - Finally check PLC, network are working properly.
懷念過去 2024-07-11 20:06:53

如果系统执行同步读取(阻塞 I/O 调用),然后实现应用程序的逻辑,然后执行同步写入(再次阻塞),那么您需要考虑到 PLC 的多次往返。

同步读取涉及App(请求)->OPCServer->PLC->OPCServer->App(结果)。 这只是一个项目的阅读(尽管您可以一次性请求一组项目)。

那么类似的同步写入也涉及App(Write)->OPCServer->PLC->OPCServer->App(Done)。

异步读取和同步读取 写入和组读取& 写入可以帮助减少应用程序的阻塞,但请注意您的应用程序可以应对这种异步行为

另一件需要注意的是 PLC 配置,在 Allen-Bradley PLC 上有一个扫描间延迟设置,用于服务 I/ O 通过外部网络发出的请求。 如果时间很短并且数据带宽很高,那么速度就会变慢。

If the system does syncronous reads (blocking I/O call), then implements the logic of your application then syncronous writes (again blocking) then you need to consider that there are multiple round-trips to the PLC.

A syncronous read involves App(request)->OPCServer->PLC->OPCServer->App(result). That is just the read for one item (although you can ask for a group of items in one go).

Then a similar sync write also involves App(Write)->OPCServer->PLC->OPCServer->App(Done).

Asyncronous reads & writes and group reads & writes can help reduce blocking of the application, but be careful that your aplication can cope with this ansyncronous behavior

The other thing to look at is the PLC configuration, On Allen-Bradley PLC's there is an interscan delay setting that is used to service I/O requests over external networks. If that time is short and you have a high bandwidth of data then this will slow things down.

Spring初心 2024-07-11 20:06:53

听起来好像您没有使用 OPC 服务器中的缓存。 通常OPC服务器有一个缓存,如果您的客户端连接并且没有指定它想要使用缓存,您将无法获得您可能需要的性能。 OPC 服务器负责刷新设备中的缓存,尽管刷新标准可能因 OPC 服务器而异。

It sounds as if you are not using the cache in the OPC server. Normally OPC servers have a cache, if your client connects and doesn't specify that it wants to use the cache you don't get the performance that you may need. The OPC server is responsible for refreshing the cache from the device although the criteria for refreshing may differ from OPC server to OPC server.

司马昭之心 2024-07-11 20:06:53

这取决于您如何配置 OPC 客户端来提取数据。 当您订阅 OPC 中的组时,您可以指定刷新率。 这可能默认为 1 秒甚至 5 秒,具体取决于 OPC 客户端。 OPC 服务器还可能对更新数据的频率施加限制。 这仅适用于您的 OPC 客户端订阅数据更改事件的情况。

另一种方法是对 OPC 服务器进行异步或同步读/写。 还有多种阅读模式。 由于您使用的是 OPC,因此您可以使用任何 OPC 兼容客户端来测试您的服务器,这将告诉您问题是否出在 Think'n'Do 中的设置上,或者是 PLC/服务器上的问题。

我用过的最好的通用 OPC 客户端是 OPC Quick Client。 您可以通过此处的 TOP 服务器获取它: http://www.toolboxopc.com/Features/演示/demo.shtml。 只需获取 TOP 服务器演示并安装 OPC 快速客户端即可。 您可以使用它连接到 OPC 服务器并浏览标签并查看数据。 我用过的第二好的 OPC 客户端来自 ICONICS(称为 OPC Data Spy),可在此处获取:http: //www.iconics.com/support/free_tools.asp

使用 OPC 客户端查看读取数据的速度。 确保正确设置组刷新率。 我认为这些工具也可能为您提供一些计时信息(但您将能够很容易地计算出 6 秒的延迟)。

It depends on how you have your OPC client configured to pull data. When you subscribe to a group in OPC, you get to specify a refresh rate. This might default to 1s or even 5s, depending on the OPC client. There's also a limit the OPC server might put on the frequency of updated data. This only applies if you have your OPC client subscribing to data change events.

The other way you can go is to do async or sync reads / writes to the OPC server. There are several reading modes as well. Since you are using OPC, you can use any OPC compatible client to test your server, this will tell you if the problem is with a setting in Think'n'Do or is it something with the PLC / server.

The best general purpose OPC client I've used is OPC Quick Client. You can get it with TOP Server here: http://www.toolboxopc.com/Features/Demo/demo.shtml. Just grab the TOP Server demo and install the OPC Quick Client. You can use it to connect to your OPC server and browse the tags and see what the data looks like. The second best OPC client I've used is from ICONICS (called OPC Data Spy) available here: http://www.iconics.com/support/free_tools.asp.

Use the OPC client to see how fast you can read the data. Make sure you set the group refresh rate correctly. I think the tools might provide some timing information for you as well (but you'll be able to figure out a 6 second delay pretty easily).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文