OPC服务器访问远程使用OPCDA.NET工具 [英] OPC server access remotely using OPCDA.NET tools

查看:1175
本文介绍了OPC服务器访问远程使用OPCDA.NET工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发的Windows的C#OPC客户端。我已经开发了code和阅读 根据抽样OPC项目,以及事件(OnDataChange)。当我 与本地机器的工作,然后我code正常工作与两个取样以及 如OnDataChange,但是当我试图读取从远程OPC服务器数据 那么采样工作正常,但我不能够获取对基于事件的处理数据。 我能够连接到OPC服务器,但是当我加入订阅 它然后我收到错误。

I am developing OPC Client in windows C#. I have developed the code and reading OPC Items on Sampling as well as event based (OnDataChange). When I am working with local machine then my code works fine with both Sampling as well as OnDataChange, but when I am trying to read data from Remote OPC Server then Sampling works fine but I am not able fetch data on event based process. I am able to connect to the OPC Server but when i am adding subscription to it then i am getting error.

HRESULT:0x80040202

HRESULT : 0x80040202.

       group1.DataChanged += new DataChangeEventHandler(this.DataChangeHandler);
               group1.AdviseIOPCDataCallback();//exception HRESULT : 0x80040202.

OPC服务器连接和放大器;然后读取数据时登记组还,但我得到了异常。

OPC server connected & then register the group also but i got the exception when reading data.

推荐答案

这个问题通常是,当你使用提醒(),服务器将进行DCOM连接回到客户端(标准DCOM连接点)。客户端需要正确设置为允许这种情况发生(即正确的安全设置,以允许服务器执行code中的客户端)。

The issue usually is that when you use Advise(), the server will make a DCOM connection back to the client (standard DCOM connection points). The client needs to be set up properly to allow this to happen (i.e. the right security settings to allow the server to execute code on the client).

您应该阅读此页: http://www.softwaretoolbox.com/xpsp2/ ,它涵盖了如何建立正确的DCOM的OPC使用了不少建议。有很多在这里的安全问题。该软件工具箱网站上有很多伟大的信息(和视频太)。如果您仍然无法得到它的工作,我建议投资于OPC隧道产品,将让你做远程OPC,无需跳转通过所有的DCOM循环。

You should read this page: http://www.softwaretoolbox.com/xpsp2/, it covers a lot of recommendations on how to set up DCOM properly for OPC usage. There are a lot of security concerns here. The Software Toolbox site has a lot of great information (and videos too). If you are still having trouble getting it to work, I recommend investing in an OPC tunneling product that will allow you to do remote OPC without having to jump through all the DCOM loops.

您不必使用OPCDA.NET到有同样的问题。您可以使用任何OPC客户端,并得到它的工作先与远程服务器,然后集中搞清楚如何得到OPCDA.NET这一切迷上了。我建议OPC快速客户端(自带的软件工具箱顶级服务器演示)。

You don't have to be using OPCDA.NET to have the same issue. You can use any OPC client and get it working first with your remote server, then focus on figuring out how to get it all hooked up in OPCDA.NET. I recommend OPC Quick Client (comes with Software Toolbox TOP Server demo).

这篇关于OPC服务器访问远程使用OPCDA.NET工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆