Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 12-May-11 19:09pm
v3

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.
 
Share this answer
 
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?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900