OPC客户端OnDataChange手中的异常frm HRESULT:0x80040202 [英] Exception frm HRESULT : 0x80040202 in OPC Client OnDataChange hand

查看:1033
本文介绍了OPC客户端OnDataChange手中的异常frm HRESULT:0x80040202的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows C#中开发OPC客户端.我已经开发了代码,并阅读了有关采样的OPC项目以及基于事件的(OnDataChange).当我在本地计算机上工作时,我的代码在Sampling以及OnDataChange上都可以正常工作,但是当我尝试从Remote OPC Server读取数据时,Sampling可以正常工作,但是我无法在基于事件的过程中获取数据.我能够连接到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.
       group1.DataChanged += new DataChangeEventHandler(this.DataChangeHandler);
               group1.AdviseIOPCDataCallback();//exception HRESULT : 0x80040202.


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

推荐答案

如果它在本地计算机上运行,​​而不在远程计算机上运行.我认为您必须查看OPC服务器上的防火墙或安全设置.查看供应商的手册,看看是否有帮助.
If it works on the local machine and not on a remote. I think you have to look at firewalls or security settings on the OPC Server. Look at the manual from the vendor and see if there is some help.


您可能遇到了DCOM问题.建议我始终在同一台机器上运行OPC通讯过程和OPC服务器.
您为OPC客户端使用了什么库?
You probably have a DCOM issue. I''m adviced to run the OPC communication process & OPC server allways on the same machine.
What library have you used for your OPC Client?


这篇关于OPC客户端OnDataChange手中的异常frm HRESULT:0x80040202的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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